diff --git a/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.md b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.md new file mode 100644 index 0000000000..484ee5a986 --- /dev/null +++ b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.md @@ -0,0 +1,57 @@ +# Complete global-risk read ownership — 2026-11-02 + +The existing `loopx global-risks` CLI now sends one complete source-observation +request to `presentation.global_risks.project`, owned by +`control_plane/presentation/global_risk_read.ts`. It validates the status +projection, normalizes diagnostics and stale warnings, derives stale host-poll +risks, filters Agent scope, aggregates occurrences, escalates severity, sorts, +limits and constructs success/error results. It composes the existing projection +envelope owner in process. Rollback candidates remain deliberately empty; this +read grants no execution authority and adds no product entrypoint. + +The synthetic 37-case compatibility corpus is green against the unchanged +Python owner in an immutable baseline archive. Its complete JSON and Markdown bytes and +one-crossing expectations remain unchanged. Instrumentation measures one +`projection.envelope.seal` crossing before and one +`presentation.global_risks.project` crossing after, including source errors and +Agent-scope failures. The receipt decoder still distinguishes missing and +unreadable persisted sources. Stale decisions require explicit expected +continuation and compare UTC instants at the inclusive 240-minute threshold, +including microsecond and offset cases. + +Deleted Python includes diagnostic expansion/normalization, stale-warning and +stale-host-poll decisions, Agent filtering, aggregation, severity ordering, +grouping, ordinary result construction and envelope composition. The sole +production caller of `stale_host_poll_risk` moved, so that helper and its threshold +constant are removed. Its implementation-only tests move to the typed owner; +complete public-output fixtures remain compatibility evidence. + +Python retains status/registry/receipt acquisition and the persisted receipt +codec because their host IO owners have not migrated. The acquisition cap mirrors +the existing bounded-source read contract; TypeScript owns result eligibility +and truncation. Python also retains Markdown rendering and its shared public +text codec. TypeScript mirrors the canonical Python path patterns from +`loopx/public_safe_text.py` under an ordered source-and-flags parity test. Normal error payloads are +constructed in TypeScript. A transport-failure-only wire codec remains in Python +because an unavailable Node runtime cannot construct its own failure response; +it reports no envelope and preserves the existing public-safe error fallback. +It does not derive risks or certify freshness. + +The Python facade and bridge operation exit when the CLI's existing status and +project-receipt acquisitions plus Markdown rendering are hosted by the typed +caller, with equivalent public error and host-unavailability behavior. There is +no new leaf RPC, persisted schema, cache, provider default or Python/TypeScript +same-basename pair. The registered `SOURCE_SURFACES` context moves to the typed +owner without changing vocabulary budgets. + +CLI parity uses an immutable archive of baseline `867615e2c` and a synthetic +empty registry/home, comparing actual JSON and Markdown commands. Only current +observation timestamps are normalized. This is source-checkout evidence, not +installed-artifact qualification. Full-tree vocabulary checks enumerate tracked +sources, so an unstaged new owner is invisible until normal review staging; +that limitation does not authorize staging or budget changes. Validation results +and physical line accounting belong to the delivery report. + +No latency, sustained runtime or long-horizon effectiveness/efficiency benefit +is claimed. Fewer Python decision lines and a coarser request establish an owner +boundary, not performance qualification or a completed migration stage. diff --git a/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.zh-CN.md b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.zh-CN.md new file mode 100644 index 0000000000..b14cee4ac6 --- /dev/null +++ b/docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.zh-CN.md @@ -0,0 +1,41 @@ +# 完整全局风险读取的所有权 — 2026-11-02 + +现有 `loopx global-risks` CLI 现在将完整来源观察一次发送到 +`presentation.global_risks.project`,其所有者为 +`control_plane/presentation/global_risk_read.ts`。该所有者验证状态投影, +规范化诊断和过期警告,推导宿主轮询过期风险,过滤 Agent 范围,聚合出现记录, +提升严重程度,排序、限制并构建成功或错误结果。它在进程内组合现有投影信封所有者。 +回滚候选仍刻意保持为空;此读取不授予执行权限,也不新增产品入口。 + +37 个合成兼容用例已在不可变基线归档中通过未修改的 Python 所有者。完整 JSON、Markdown +字节及一次跨运行时调用的预期保持不变。插桩测得修改前一次 +`projection.envelope.seal` 调用,修改后一次 +`presentation.global_risks.project` 调用,包括来源错误和 Agent 范围失败。 +收据解码器仍区分持久化来源缺失与不可读。过期判定要求明确的预期继续标志, +按 UTC 时刻比较包含边界的 240 分钟阈值,并覆盖微秒及偏移量情况。 + +删除的 Python 包括诊断展开与规范化、过期警告及宿主轮询过期判定、Agent 过滤、 +聚合、严重程度排序、分组、常规结果构建及信封组合。 +`stale_host_poll_risk` 的唯一生产调用方已迁移,因此删除该辅助函数及阈值常量。 +实现专属测试移至类型化所有者;完整公开输出夹具保留为兼容性证据。 + +Python 保留状态、注册表和收据获取以及持久化收据编解码器,因为这些宿主 IO +所有者尚未迁移。获取上限遵循现有有界来源读取合同;TypeScript 拥有结果资格及 +截断判定。Python 也保留 Markdown 渲染及其共享公开文本编解码器。TypeScript +镜像 `loopx/public_safe_text.py` 中的 Python 规范路径模式,并通过按顺序比较 +模式源文本及标志的一致性测试保护。常规错误载荷由 TypeScript 构建。Python 仅保留传输失败时的线格式 +编解码器,因为不可用的 Node 运行时无法构建自身失败响应;它不报告信封, +并保留现有公开安全错误降级行为,不推导风险或证明新鲜度。 + +当 CLI 现有状态和项目收据获取及 Markdown 渲染迁入类型化调用方,且公开错误及 +宿主不可用行为等价时,删除 Python 门面及桥接操作。本次不新增叶级 RPC、 +持久化模式、缓存、提供方默认值或 Python/TypeScript 同名文件对。 +已登记的 `SOURCE_SURFACES` 上下文迁至类型化所有者,词汇预算不变。 + +CLI 对比使用不可变基线 `867615e2c` 的归档以及合成空注册表与主目录,比较实际 +JSON 和 Markdown 命令,仅规范化当前观察时间戳。这是源码检出证据,不是安装 +产物资格。全树词汇检查只枚举已跟踪来源,因此未暂存的新所有者在正常审阅暂存前 +不可见;此限制不授权暂存或修改预算。验证结果和物理行数核算属于交付报告。 + +不宣称延迟、持续运行时或长程效果与效率收益。更少的 Python 判定代码和更粗粒度 +请求证明的是所有权边界,不是性能资格或迁移阶段完成。 diff --git a/docs/architecture/rfcs/typescript-control-plane-migration-v0.md b/docs/architecture/rfcs/typescript-control-plane-migration-v0.md index d2fd4bf976..5e33fb97a1 100644 --- a/docs/architecture/rfcs/typescript-control-plane-migration-v0.md +++ b/docs/architecture/rfcs/typescript-control-plane-migration-v0.md @@ -2837,3 +2837,4 @@ with shared write/read status-phase checks. See the [2026-10-02 checkpoint](ledg - Summary-display final-head qualification and preserved tail cohorts: [2026-10-27 follow-up](ledger/typescript-control-plane-migration-v0/2026-10-27-todo-summary-qualification.md). - Quota summary composition in one `todo.quota_planning.project` crossing with source references: [2026-11-02 cutover](ledger/typescript-control-plane-migration-v0/2026-11-02-quota-summary-transaction.md). - Complete global summary and gate read transactions: [2026-11-02 checkpoint](ledger/typescript-control-plane-migration-v0/2026-11-02-global-manager-reads.md). +- Complete global-risk read ownership: [2026-11-02](ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.md). diff --git a/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md b/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md index f8fb45a01a..a8eb130218 100644 --- a/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md +++ b/docs/architecture/rfcs/typescript-control-plane-migration-v0.zh-CN.md @@ -2102,3 +2102,4 @@ SQLite 中位数略升,收益不能外推为全面加速。这只资格化本 - 摘要展示最终 head 验收与历史尾延迟批次:[2026-10-27 后续记录](ledger/typescript-control-plane-migration-v0/2026-10-27-todo-summary-qualification.zh-CN.md)。 - 配额摘要经来源引用在一次 `todo.quota_planning.project` 跨运行时调用内完成组合:[2026-11-02 切换记录](ledger/typescript-control-plane-migration-v0/2026-11-02-quota-summary-transaction.zh-CN.md)。 - 完整全局摘要与门禁读取事务:[2026-11-02 检查点](ledger/typescript-control-plane-migration-v0/2026-11-02-global-manager-reads.zh-CN.md)。 +- 完整全局风险读取所有权:[2026-11-02](ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.zh-CN.md)。 diff --git a/loopx/control_plane/effect_runtime_handlers.ts b/loopx/control_plane/effect_runtime_handlers.ts index 4c829f95f6..f7b78c898a 100644 --- a/loopx/control_plane/effect_runtime_handlers.ts +++ b/loopx/control_plane/effect_runtime_handlers.ts @@ -467,6 +467,7 @@ export function createEffectRuntimeHandlers( ["task_lease.write_scopes.overlap", lazyHandler(() => import("./work_items/task_lease_acquire_decision.ts"), ({evaluateTaskLeaseWriteScopesOverlap}) => evaluateTaskLeaseWriteScopesOverlap)], ["quota.task_orchestration.write_scope_overlap", lazyHandler(() => import("./work_items/task_lease_acquire_decision.ts"), ({evaluateQuotaSchedulingWriteScopesOverlap}) => evaluateQuotaSchedulingWriteScopesOverlap)], ["quota.monitor_poll.commit", lazyHandler(() => import("./quota/monitor_poll_commit.ts"), ({evaluateQuotaMonitorPollCommit}) => evaluateQuotaMonitorPollCommit)], + ["presentation.global_risks.project", lazyHandler(() => import("./presentation/global_risk_read.ts"), ({projectGlobalRisks}) => projectGlobalRisks)], ["presentation.decision_notice.project", lazyHandler(() => import("./presentation/decision_notice.ts"), ({projectDecisionNotice}) => projectDecisionNotice)], ["presentation.decision_notice.validate_references", lazyHandler(() => import("./presentation/decision_notice.ts"), ({validateDecisionNoticeReferences}) => validateDecisionNoticeReferences)], ["presentation.global_summary.project", lazyHandler(() => import("./presentation/global_manager_read.ts"), ({projectGlobalSummary}) => projectGlobalSummary)], diff --git a/loopx/control_plane/presentation/global_risk_read.ts b/loopx/control_plane/presentation/global_risk_read.ts new file mode 100644 index 0000000000..e6960758b4 --- /dev/null +++ b/loopx/control_plane/presentation/global_risk_read.ts @@ -0,0 +1,338 @@ +import {createHash} from "node:crypto"; +import type {JsonObject} from "../effect_program.ts"; +import {jsonObject, requireInteger, requireJsonObject, requireNonEmptyString} from "../runtime_decode.ts"; +import {sealProjectionEnvelope} from "../projection_envelope.ts"; +import {parseTodoTimestampMicros} from "../runtime_timestamp.ts"; +import {normalizeTodoAgent, stripPythonWhitespace, compactPythonWhitespace} from "../coordination/todo_agents.ts"; + +const COMMAND = "/loopx-global-risks"; +const CONTRACT = "status.contract.error_diagnostics"; +const REGISTRY = "status.global_registry.findings"; +const STALE = "status.attention_queue.items.stale_latest_run_warning"; +const POLL = "project.host_poll_receipts"; +const SEVERITY: Record = {high: 0, action: 1, warning: 2, info: 3}; +const CATEGORY: Record = {boundary_warning: 0, failing_check: 1, stale_run: 2}; +export const SOURCE_SURFACES = ["status contract diagnostics", "global registry health findings", + "status attention queue stale-run warnings", "status compact run-history coordination"] as const; +const object = (value: unknown): JsonObject => jsonObject(value) ?? {}; +const list = (value: unknown): unknown[] => Array.isArray(value) ? value : []; +const truth = (value: unknown): boolean => value !== null && value !== undefined && value !== false && value !== 0 && value !== "" && + (!Array.isArray(value) || value.length > 0) && (!jsonObject(value) || Object.keys(object(value)).length > 0); +function pyString(value: unknown, nested = false): string { + if (value === null || value === undefined) return "None"; + if (typeof value === "boolean") return value ? "True" : "False"; + if (typeof value === "string") return nested ? `'${value.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'` : value; + if (Array.isArray(value)) return `[${value.map(item => pyString(item, true)).join(", ")}]`; + if (jsonObject(value)) return `{${Object.entries(object(value)).map(([key, item]) => `${pyString(key, true)}: ${pyString(item, true)}`).join(", ")}}`; + return String(value); +} +const text = (value: unknown): string => stripPythonWhitespace(pyString(truth(value) ? value : "")); + +// Mirrors loopx/public_safe_text.py PRESENTATION_LOCAL_PATH_PATTERNS; guarded by parity test. +export const LOCAL_PATH_PATTERNS = [ + /\/(?:Users|home|private|tmp|var)\/[^\s`|,)]+/gu, + /(?]+|[A-Za-z]:[\\/][^\s`'"<>]+|\\\\[A-Za-z0-9_.-]+\\[^\s`'"<>]+)/giu, + /\\\\\?\\(?:UNC\\[A-Za-z0-9_.-]+\\|Volume\{[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}\}\\|GLOBALROOT\\Device\\)[^\s`|,)]+/giu, + /(?<=:)(?:[A-Za-z]:[\\/][^\s`|,)]+|\\\\\?\\(?:UNC\\[A-Za-z0-9_.-]+\\|Volume\{[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}\}\\)[^\s`|,)]+|\\\\\?\\GLOBALROOT\\Device\\[^\s`|,)]+|\\\\[A-Za-z0-9_.-]+\\[^\s`|,)]+)/giu, +]; + +// Presentation codec parity includes Python whitespace and code-point limits. +function redact(value: unknown, limit = 260): string { + let result = text(value).replaceAll("/loop-global-risks", COMMAND); + for (const pattern of LOCAL_PATH_PATTERNS) result = result.replace(pattern, ""); + result = compactPythonWhitespace(result); + const chars = Array.from(result); + return chars.length > limit ? stripPythonWhitespace(chars.slice(0, Math.max(0, limit - 1)).join("")) + "…" : result; +} +function boundary(): JsonObject { + return Object.fromEntries(["raw_logs_recorded", "raw_transcripts_recorded", "raw_connector_payloads_recorded", + "credential_values_recorded", "absolute_paths_recorded", "private_source_bodies_recorded"].map(key => [key, false])); +} +function timeRange(value: unknown): string { + const normalized = text(value || "24h").toLowerCase(); + return /^\d+[hd]$/u.test(normalized) && Number(normalized.slice(0, -1)) > 0 ? normalized : "24h"; +} +function request(value: unknown): JsonObject { + return {schema_version: "global_manager_command_request_v0", command: COMMAND, + legacy_aliases: ["/loop-global-risks"], cli_command: "loopx global-risks", time_range: timeRange(value), + include: ["stale_runs", "boundary_warnings", "failing_checks", "rollback_candidates"], + privacy_mode: "public_safe_summary", dry_run: true}; +} +function warning(code: string, source: string, extras: JsonObject = {}): JsonObject { + const result: JsonObject = {reason_code: redact(code, 120)}; + if (source) result.source = redact(source, 160); + for (const key of ["goal_id", "detail"]) if (truth(extras[key])) result[key] = redact(extras[key], key === "goal_id" ? 120 : 260); + for (const key of ["available_count", "inspected_count"]) if (extras[key] != null) result[key] = extras[key]; + return result; +} +function occurrence(source: string, index: number, kind: string, scope: string, goal: string | null): string { + const identity = {goal_id: goal, kind, scope, source_index: index, source_surface: source}; + const encoded = JSON.stringify(identity).replace(/[\u007f-\uffff]/gu, char => `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}`); + return createHash("sha256").update(encoded).digest("hex").slice(0, 16); +} +function severity(value: unknown, fallback = "warning"): string { + const normalized = text(value); + return normalized === "error" ? "high" : Object.hasOwn(SEVERITY, normalized) ? normalized : fallback; +} +function contractRows(raw: unknown, index: number, warnings: JsonObject[]): JsonObject[] { + const diagnostic = jsonObject(raw); + if (!diagnostic) { warnings.push(warning("malformed_contract_diagnostic", CONTRACT)); return []; } + const code = text(diagnostic.code); + if (!code) { warnings.push(warning("contract_code_missing", CONTRACT)); return []; } + const scope = text(diagnostic.scope || "global") || "global", goal = text(diagnostic.goal_id); + const goals: (string | null)[] = []; + if (scope !== "goals") goals.push(goal || null); + else { + if (diagnostic.goal_ids != null && !Array.isArray(diagnostic.goal_ids)) warnings.push(warning("malformed_contract_goal_ids", CONTRACT)); + for (const rawId of list(diagnostic.goal_ids)) { + const id = text(rawId); + if (id && !goals.includes(id)) goals.push(id); + } + if (goal && !goals.includes(goal)) goals.push(goal); + if (!goals.length) warnings.push(warning("contract_goal_identity_missing", CONTRACT)); + } + return goals.map(id => { + const hash = occurrence(CONTRACT, index, code, scope, id); + const action = code === "public_boundary_violation" ? "Inspect and remove the boundary violation before delivery." + : code === "registry_boundary_risk" ? "Inspect and repair the registry boundary projection." + : `Inspect and resolve contract check ${code} before relying on this goal.`; + return {goal_id: redact(id, 120) || null, scope: redact(scope, 120), + category: ["public_boundary_violation", "registry_boundary_risk"].includes(code) ? "boundary_warning" : "failing_check", + kind: redact(code, 120), severity: severity(diagnostic.severity, "high"), + summary: redact(diagnostic.message) || `Contract check ${code} failed.`, occurrence_id: hash, occurrence_count: 1, + evidence_refs: [`${CONTRACT}:${code}:${hash}`], next_safe_action: action, requires_user_approval: false}; + }); +} +function registryRows(raw: unknown, index: number, warnings: JsonObject[]): JsonObject[] { + const finding = jsonObject(raw); + if (!finding) { warnings.push(warning("malformed_registry_finding", REGISTRY)); return []; } + const level = text(finding.severity); + if (!["high", "action"].includes(level)) return []; + const kind = text(finding.kind); + if (!kind) { warnings.push(warning("registry_kind_missing", REGISTRY)); return []; } + const goal = text(finding.goal_id) || null, scope = goal ? "goal" : "global"; + const hash = occurrence(REGISTRY, index, kind, scope, goal); + return [{goal_id: redact(goal, 120) || null, scope, category: "failing_check", kind: redact(kind, 120), severity: level, + summary: redact(finding.message) || `Global registry finding ${kind} requires attention.`, occurrence_id: hash, occurrence_count: 1, + evidence_refs: [`${REGISTRY}:${kind}:${hash}`], + next_safe_action: redact(finding.recommended_action) || `Inspect and resolve global registry finding ${kind}.`, requires_user_approval: false}]; +} +function timestamp(value: unknown): string | null { + const stamp = text(value); + return stamp && parseTodoTimestampMicros(stamp) !== null && !stamp.endsWith("z") ? stamp : null; +} +function staleRows(raw: unknown, index: number, warnings: JsonObject[]): JsonObject[] { + const item = jsonObject(raw); + if (!item) { warnings.push(warning("malformed_attention_item", STALE)); return []; } + if (item.stale_latest_run_warning == null) return []; + const stale = jsonObject(item.stale_latest_run_warning); + if (!stale) { warnings.push(warning("malformed_stale_warning", STALE)); return []; } + const kind = text(stale.kind); + if (kind !== "stale_latest_run_projection") { warnings.push(warning("invalid_stale_warning_kind", STALE)); return []; } + const goal = text(item.goal_id) || null, scope = goal ? "goal" : "global"; + const hash = occurrence(STALE, index, kind, scope, goal), reason = redact(stale.reason, 160); + const row: JsonObject = {goal_id: redact(goal, 120) || null, scope, category: "stale_run", kind, + severity: severity(stale.severity), summary: reason || "Latest-run routing is stale relative to active state.", reason: reason || null, + occurrence_id: hash, occurrence_count: 1, evidence_refs: [`${STALE}:${kind}:${hash}`], + next_safe_action: "Run refresh-state before trusting latest-run routing.", requires_user_approval: false}; + for (const field of ["latest_run_generated_at", "active_state_updated_at"]) { + const stamp = timestamp(stale[field]); + if (stamp === null) warnings.push(warning("invalid_stale_timestamp", STALE, {goal_id: goal, detail: `Structured stale warning has no valid ${field}.`})); + else row[field] = stamp; + } + return [row]; +} +function pollRows(host: JsonObject, now: string, warnings: JsonObject[], scan: number): { + rows: JsonObject[]; status: string; count: number | null; omitted: number; unreadable: number; refs: string[]; +} { + const result = {rows: [] as JsonObject[], status: "missing", count: null as number | null, omitted: 0, unreadable: 0, refs: [] as string[]}; + if (host.error != null) { + warnings.push(warning("host_poll_registry_unreadable", POLL, {detail: Array.from(pyString(host.error)).slice(0, 200).join("")})); + return {...result, status: "unreadable", unreadable: 1}; + } + if (host.read_status === "missing") return result; + if (!Array.isArray(host.goals)) return {...result, status: "unreadable", unreadable: 1}; + result.status = "read"; result.count = 0; result.omitted = Math.max(0, requireInteger(host.goal_count, "host_poll.goal_count") - scan); + for (const [index, raw] of host.goals.slice(0, scan).entries()) { + const entry = object(raw), goal = object(entry.goal), observation = object(entry.observation); + if (!truth(goal.id)) continue; + if (observation.read_status === "missing") continue; + const ref = redact(pyString(goal.id || ""), 120), receipt = jsonObject(observation.receipt); + if (observation.read_status !== "read" || !receipt) { + result.unreadable++; + if (ref && result.refs.length < 8) result.refs.push(ref); + continue; + } + result.count++; + if (receipt.expected_continuation !== true || typeof receipt.last_poll_at !== "string") continue; + const last = timestamp(receipt.last_poll_at), current = parseTodoTimestampMicros(now); + if (!last || current === null || current - parseTodoTimestampMicros(last)! < 240n * 60n * 1000000n) continue; + const reason = redact("The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intentionally; check the session and LoopX gates before resuming.", 200); + const id = ref || null, kind = "stale_host_poll"; + result.rows.push({goal_id: id, scope: "goal", category: "stale_run", kind, severity: "warning", summary: reason, reason, + occurrence_id: occurrence(POLL, index, kind, "goal", id), occurrence_count: 1, + evidence_refs: [`${POLL}:${kind}:${receipt.last_poll_at}`], + next_safe_action: "Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.", requires_user_approval: true}); + } + return result; +} +function bounded(rows: unknown[], source: string, scan: number, warnings: JsonObject[]): unknown[] { + if (rows.length > scan) warnings.push(warning("source_rows_truncated", source, {available_count: rows.length, inspected_count: scan})); + return rows.slice(0, scan); +} +function filterAgent(rows: JsonObject[], status: JsonObject, agent: string | null, scan: number, warnings: JsonObject[]): [JsonObject[], boolean] { + if (!agent) return [rows, false]; + const history = jsonObject(status.run_history); + if (!history) throw new Error("compact run-history projection is missing or malformed"); + if (!Array.isArray(history.goals)) throw new Error("compact run-history goal list is missing or malformed"); + const goals = new Map(); + for (const raw of bounded(history.goals, "status.run_history.goals", scan, warnings)) { + const goal = object(raw), id = text(goal.id); + if (id && !goals.has(id)) goals.set(id, goal); + } + return [rows.filter(row => { + const id = text(row.goal_id); + if (!id) return true; + const goal = goals.get(id); + if (!goal) throw new Error(`agent scope unavailable for goal ${id}`); + const registered = object(goal.coordination).registered_agents; + if (!Array.isArray(registered)) throw new Error("agent scope unavailable for goal"); + return registered.some(raw => { + const item = jsonObject(raw); + const value = item ? item.id || item.agent_id || item.name : raw; + try { return normalizeTodoAgent(compactPythonWhitespace(pyString(value || "")), "agent") === agent; } + catch { return false; } + }); + }), history.goals.length > scan]; +} +const count = (value: unknown): number => typeof value === "number" && Number.isInteger(value) && value > 0 ? value : 1; +export function aggregateGlobalRisks(rows: JsonObject[]): JsonObject[] { + const result = new Map(); + for (const row of rows) { + const key = JSON.stringify([row.category, row.kind, row.goal_id || "", row.occurrence_id].map(value => pyString(value || ""))); + const existing = result.get(key); + if (!existing) result.set(key, {...row, occurrence_count: count(row.occurrence_count), evidence_refs: list(row.evidence_refs).map(item => pyString(item)).filter(Boolean)}); + else { + existing.occurrence_count = count(existing.occurrence_count) + count(row.occurrence_count); + if ((SEVERITY[text(row.severity)] ?? 4) < (SEVERITY[text(existing.severity)] ?? 4)) existing.severity = row.severity; + existing.evidence_refs = [...new Set([...list(existing.evidence_refs), ...list(row.evidence_refs)])]; + } + } + return [...result.values()]; +} +function compare(left: JsonObject, right: JsonObject): number { + const key = (row: JsonObject): (number | string)[] => [SEVERITY[text(row.severity)] ?? 4, CATEGORY[text(row.category)] ?? 3, + truth(row.goal_id) ? 1 : 0, text(row.goal_id), text(row.kind), pyString(list(row.evidence_refs)[0] ?? "")]; + const a = key(left), b = key(right); + for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) { + if (typeof a[i] === "number" && typeof b[i] === "number") return Number(a[i]) - Number(b[i]); + const left = Array.from(String(a[i]), char => char.codePointAt(0)!); + const right = Array.from(String(b[i]), char => char.codePointAt(0)!); + for (let j = 0; j < Math.min(left.length, right.length); j++) if (left[j] !== right[j]) return left[j] - right[j]; + return left.length - right.length; + } + return 0; +} +function groups(rows: JsonObject[]): JsonObject { + return {stale_runs: rows.filter(row => row.category === "stale_run"), boundary_warnings: rows.filter(row => row.category === "boundary_warning"), + failing_checks: rows.filter(row => row.category === "failing_check"), rollback_candidates: []}; +} +function risksEnvelope(status: JsonObject, now: string, readAt: string | null, + poll: ReturnType, omittedRows: number, shown: number, availableCount: number, agent: string | null): JsonObject { + const registry = object(status.global_registry), upstream = object(status.projection_envelope); + const globalSource = object(list(upstream.sources).find(raw => object(raw).source_id === "global_registry")); + const available = registry.available === true; + const expected = available && typeof registry.global_goal_count === "number" && Number.isInteger(registry.global_goal_count) ? registry.global_goal_count : null; + const excluded = available ? Number(registry.current_registry_excluded_goal_count || 0) : 0; + const omitted: JsonObject[] = []; + if (excluded) omitted.push({reason: "outside_current_registry", count: excluded, refs: list(registry.current_registry_excluded_goal_ids).slice(0, 8).map(item => pyString(item))}); + if (omittedRows) omitted.push({reason: "source_rows_not_scanned", count: omittedRows}); + if (poll.omitted) omitted.push({reason: "host_poll_goals_not_scanned", count: poll.omitted}); + if (poll.unreadable) omitted.push({reason: "host_poll_receipts_unreadable", count: poll.unreadable, refs: poll.refs.slice(0, 8)}); + if (truth(status) && status.ok !== true) omitted.push({reason: "status_unavailable", count: 1}); + const contract = object(status.contract), queue = object(status.attention_queue), history = object(status.run_history); + const contractRead = !!jsonObject(status.contract) && (!Object.hasOwn(contract, "error_diagnostics") || Array.isArray(contract.error_diagnostics)); + const queueRead = !!jsonObject(status.attention_queue) && (!Object.hasOwn(queue, "items") || Array.isArray(queue.items)); + const source = (id: string, readStatus: unknown, at: unknown, itemCount: unknown, unreadable = 0): JsonObject => ({source_id: id, + read_status: readStatus, last_read_at: at, required: true, source_updated_at: null, item_count: itemCount, missing_count: 0, unreadable_count: unreadable}); + const sources = [source("global_registry", available ? globalSource.read_status || "read" : registry.read_status || (readAt ? "missing" : "not_read"), + globalSource.last_read_at || (available ? readAt : null), expected), + source("status_contract", contractRead ? "read" : "not_read", contractRead ? readAt : null, contractRead ? list(contract.error_diagnostics).length : null), + source("attention_queue", queueRead ? "read" : "not_read", queueRead ? readAt : null, queueRead ? list(queue.items).length : null), + source("host_poll_receipts", poll.status, poll.status === "read" ? now : null, poll.count, poll.unreadable)]; + if (!truth(upstream)) sources.push(source("status", "not_read", null, null)); + if (agent) sources.push(source("agent_scope", Array.isArray(history.goals) ? "read" : "not_read", + Array.isArray(history.goals) ? readAt : null, truth(history) ? list(history.goals).length : null)); + return sealProjectionEnvelope({schema_version: "loopx_projection_envelope_seal_request_v0", projection: "global_risks", observed_at: now, + sources, coverage: {scope: "global", expected_count: expected, included_count: expected === null ? 0 : Math.max(0, expected - excluded), + omitted, shown_count: shown, available_count: availableCount}, upstream: truth(upstream) ? [upstream] : []}); +} +function errorResult(error: unknown, code: unknown, range: unknown, status: JsonObject, now: string, readAt: string | null): JsonObject { + const payload: JsonObject = {ok: false, schema_version: "global_manager_command_response_v0", generated_at: now, + request: request(range), error_code: redact(code, 120), error: redact(error), + omissions: ["Raw/private failure details and local paths were intentionally omitted."], boundary: boundary()}; + try { payload.projection_envelope = risksEnvelope(status, now, readAt, + {rows: [], status: "not_read", count: null, omitted: 0, unreadable: 0, refs: []}, 0, 0, 0, null); } + catch { /* Failure reporting remains available when envelope facts are invalid. */ } + return payload; +} + +export function projectGlobalRisks(input: JsonObject): JsonObject { + if (input.schema_version !== "loopx_global_risks_read_v0") throw new TypeError("unsupported global risks read schema"); + const now = requireNonEmptyString(input.observed_at, "observed_at"); + if (parseTodoTimestampMicros(now, true) === null) throw new TypeError("observed_at must be an aware timestamp"); + const limit = Math.min(100, Math.max(1, requireInteger(input.limit, "limit"))); + const scan = Math.min(400, Math.max(limit * 4, 40)); + if (input.agent_id !== null && typeof input.agent_id !== "string") throw new TypeError("agent_id must be a string or null"); + if (typeof input.time_range !== "string") throw new TypeError("time_range must be a string"); + const agent = input.agent_id || null, range = timeRange(input.time_range); + const status = jsonObject(input.status); + const readAt = status ? now : null; + if (input.error != null) return errorResult(input.error, input.error_code || "global_risks_unavailable", range, status ?? {}, now, input.status_read_at == null ? null : now); + if (!status) return errorResult("Global status payload is not an object.", "malformed_status_projection", range, {}, now, null); + let diagnostics: unknown[], findings: unknown[], items: unknown[]; + try { + const required = (key: string): JsonObject => { + const value = jsonObject(status[key]); + if (!value) throw new Error(`Required status projection ${key} is missing or malformed.`); + return value; + }; + const contract = required("contract"), registry = required("global_registry"), queue = required("attention_queue"); + const optional = (container: JsonObject, key: string): unknown[] => { + if (!Object.hasOwn(container, key)) return []; + if (!Array.isArray(container[key])) throw new Error(`Required status source list ${key} is malformed.`); + return container[key]; + }; + diagnostics = optional(contract, "error_diagnostics"); findings = optional(registry, "findings"); items = optional(queue, "items"); + } catch (error) { return errorResult((error as Error).message, "malformed_status_projection", range, status, now, readAt); } + const warnings: JsonObject[] = []; + let rows = bounded(diagnostics, CONTRACT, scan, warnings).flatMap((raw, index) => contractRows(raw, index, warnings)); + let truncated = diagnostics.length > scan; + if (object(status.global_registry).available === false) warnings.push(warning("global_registry_unavailable", "status.global_registry")); + else { + rows.push(...bounded(findings, REGISTRY, scan, warnings).flatMap((raw, index) => registryRows(raw, index, warnings))); + truncated ||= findings.length > scan; + } + rows.push(...bounded(items, STALE, scan, warnings).flatMap((raw, index) => staleRows(raw, index, warnings))); + truncated ||= items.length > scan; + const host = requireJsonObject(input.host_poll, "host_poll"); + const poll = pollRows(host, now, warnings, scan); + rows.push(...poll.rows); truncated ||= poll.omitted > 0; + try { + const filtered = filterAgent(rows, status, agent, scan, warnings); + rows = filtered[0]; truncated ||= filtered[1]; + } catch (error) { return errorResult((error as Error).message, "agent_scope_unavailable", range, status, now, readAt); } + const aggregated = aggregateGlobalRisks(rows).sort(compare), retained = aggregated.slice(0, limit), fullGroups = groups(aggregated); + return {ok: true, schema_version: "global_manager_command_response_v0", generated_at: now, request: request(range), + summary: {source_health_ok: status.ok === true, matched_risk_count: aggregated.length, + matched_occurrence_count: aggregated.reduce((sum, row) => sum + count(row.occurrence_count), 0), returned_risk_count: retained.length, + source_scan_limit: scan, source_rows_truncated: truncated, stale_run_count: list(fullGroups.stale_runs).length, + boundary_warning_count: list(fullGroups.boundary_warnings).length, failing_check_count: list(fullGroups.failing_checks).length, + rollback_candidate_count: 0, rollback_candidates_overlap_risks: false, truncated: aggregated.length > retained.length, + source_warning_count: warnings.length, source_surfaces: SOURCE_SURFACES}, + groups: groups(retained), risks: retained, source_warnings: warnings.slice(0, 8), source_warnings_truncated: warnings.length > 8, + projection_envelope: risksEnvelope(status, now, readAt, poll, + warnings.filter(row => row.reason_code === "source_rows_truncated").reduce((sum, row) => sum + Math.max(0, Number(row.available_count || 0) - Number(row.inspected_count || 0)), 0), + retained.length, aggregated.length, agent), + omissions: [{kind: "rollback_candidate_source_unavailable", reason: "Current projections do not carry rollback trigger and causal linkage."}], boundary: boundary()}; +} diff --git a/loopx/control_plane/quota/host_poll_receipts.py b/loopx/control_plane/quota/host_poll_receipts.py index 96153673ed..c2c3837b27 100644 --- a/loopx/control_plane/quota/host_poll_receipts.py +++ b/loopx/control_plane/quota/host_poll_receipts.py @@ -25,7 +25,6 @@ HOST_POLL_RECEIPT_SCHEMA_VERSION = "loopx_host_poll_receipt_v0" HOST_POLL_RECEIPT_DIRNAME = ".loopx-host-poll-receipts" -HOST_POLL_STALE_MINUTES = 240 _UNCHANGED_WORKER_OBSERVATION = object() @@ -262,46 +261,3 @@ def read_host_poll_receipt_observation( except ValueError: return {"read_status": "unreadable", "receipt": None} return {"read_status": "read", "receipt": payload} - - -def stale_host_poll_risk( - receipt: dict[str, Any], - *, - now: datetime | None = None, - stale_minutes: int = HOST_POLL_STALE_MINUTES, -) -> dict[str, Any] | None: - """Derive a compact stale-loop risk row from one receipt.""" - - if not isinstance(receipt, dict): - return None - if receipt.get("expected_continuation") is not True: - return None - raw_last_poll = receipt.get("last_poll_at") - if not isinstance(raw_last_poll, str): - return None - try: - last_poll = datetime.fromisoformat(raw_last_poll) - except ValueError: - return None - current = now or datetime.now(timezone.utc) - if last_poll.tzinfo is None: - last_poll = last_poll.replace(tzinfo=timezone.utc) - age_minutes = (current - last_poll).total_seconds() / 60 - if age_minutes < stale_minutes: - return None - return { - "schema_version": "loopx_stale_host_poll_risk_v0", - "kind": "stale_host_poll", - "goal_id": str(receipt.get("goal_id") or ""), - "agent_id": str(receipt.get("agent_id") or ""), - "last_poll_at": raw_last_poll, - "age_minutes": round(age_minutes, 1), - "stale_minutes": stale_minutes, - "poll_count": receipt.get("poll_count"), - "reason": ( - "The host loop polled quota while expecting continuation but has " - "gone quiet for longer than the staleness window. The driver may " - "have died mid-wait, or the loop may have been paused or stopped " - "intentionally; check the session and LoopX gates before resuming." - ), - } diff --git a/loopx/global_risks.py b/loopx/global_risks.py index aeec76069b..663138f5e2 100644 --- a/loopx/global_risks.py +++ b/loopx/global_risks.py @@ -1,18 +1,17 @@ +"""Host source acquisition and Markdown codec for the typed global-risk read. + +The facade exits when the CLI acquires status and project receipt sources in +TypeScript. Receipt files retain their Python persisted-format decoder. +""" from __future__ import annotations -import hashlib -import json from collections.abc import Callable -from datetime import datetime from importlib import import_module from pathlib import Path from typing import Any, Protocol, cast -from .control_plane.projection_envelope_facts import ( - render_projection_envelope_markdown, - seal_projection_envelope, - source_fact, -) +from .control_plane.effect_runtime import effect_runtime_result +from .control_plane.projection_envelope_facts import render_projection_envelope_markdown class _CollectStatus(Protocol): def __call__( @@ -33,10 +32,6 @@ def __call__( ) -> dict[str, Any]: ... -normalize_registered_agents = cast( - Callable[[Any], list[str]], - getattr(import_module("loopx.agent_registry"), "normalize_registered_agents"), -) now_utc_iso = cast( Callable[[], str], getattr(import_module("loopx.control_plane.runtime.time"), "now_utc_iso"), @@ -84,15 +79,6 @@ def __call__( "read_host_poll_receipt_observation", ), ) -stale_host_poll_risk = cast( - Callable[..., dict[str, Any] | None], - getattr( - import_module("loopx.control_plane.quota.host_poll_receipts"), - "stale_host_poll_risk", - ), -) - - def as_dict(value: object) -> dict[str, Any]: return value if isinstance(value, dict) else {} @@ -102,40 +88,37 @@ def as_list(value: object) -> list[Any]: COMMAND = "/loopx-global-risks" -SCHEMA_VERSION = "global_manager_command_response_v0" -SOURCE_WARNING_LIMIT = 8 -MAX_RESULT_LIMIT = 100 -MAX_SCAN_LIMIT = 400 -BOUNDARY_CODES = {"public_boundary_violation", "registry_boundary_risk"} -SEVERITY_RANK = {"high": 0, "action": 1, "warning": 2, "info": 3} -CATEGORY_RANK = {"boundary_warning": 0, "failing_check": 1, "stale_run": 2} -SOURCE_SURFACES = [ - "status contract diagnostics", - "global registry health findings", - "status attention queue stale-run warnings", - "status compact run-history coordination", -] - -_CONTRACT_SOURCE = "status.contract.error_diagnostics" -_REGISTRY_SOURCE = "status.global_registry.findings" -_STALE_SOURCE = "status.attention_queue.items.stale_latest_run_warning" -_HOST_POLL_SOURCE = "project.host_poll_receipts" -_ROLLBACK_OMISSION = { - "kind": "rollback_candidate_source_unavailable", - "reason": "Current projections do not carry rollback trigger and causal linkage.", -} def _redact_text(value: object, *, limit: int = 260) -> str: - return redact_public_text( - value, - limit=limit, - replacements={"/loop-global-risks": COMMAND}, - truncation_marker="…", - ) - - -def _normalize_time_range(value: str) -> str: + return redact_public_text(value, limit=limit, + replacements={"/loop-global-risks": COMMAND}, truncation_marker="…") + + +def _read_host_poll_sources(registry_path: Path, scan_limit: int) -> dict[str, Any]: + try: + registry = load_registry(registry_path) + except FileNotFoundError: + return {"read_status": "missing"} + except (OSError, ValueError) as exc: + return {"error": str(exc)} + goals = registry.get("goals") if isinstance(registry, dict) else None + if not isinstance(goals, list): + return {"read_status": "unreadable"} + rows = [] + for goal in goals[:scan_limit]: + observation = {"read_status": "missing", "receipt": None} + if isinstance(goal, dict) and goal.get("id"): + state_path = resolve_goal_local_path(goal.get("state_file"), goal, + fallback_base=registry_path.parent) + observation = read_host_poll_receipt_observation( + receipt_path_for_goal(goal, state_path), + expected_goal_id=str(goal.get("id") or "")) + rows.append({"goal": goal, "observation": observation}) + return {"read_status": "read", "goals": rows, "goal_count": len(goals)} + + +def _transport_error_time_range(value: str) -> str: normalized = str(value or "24h").strip().lower() if normalized.endswith("h") and normalized[:-1].isdigit(): hours = int(normalized[:-1]) @@ -148,13 +131,13 @@ def _normalize_time_range(value: str) -> str: return "24h" -def _request(time_range: str) -> dict[str, Any]: +def _transport_error_request(time_range: str) -> dict[str, Any]: return { "schema_version": "global_manager_command_request_v0", "command": COMMAND, "legacy_aliases": ["/loop-global-risks"], "cli_command": "loopx global-risks", - "time_range": _normalize_time_range(time_range), + "time_range": _transport_error_time_range(time_range), "include": [ "stale_runs", "boundary_warnings", @@ -167,954 +150,48 @@ def _request(time_range: str) -> dict[str, Any]: def build_global_risks_error( - error: object, - *, - time_range: str = "24h", - error_code: str = "global_risks_unavailable", - status_payload: dict[str, Any] | None = None, - status_read_at: str | None = None, -) -> dict[str, Any]: - payload = { - "ok": False, - "schema_version": SCHEMA_VERSION, - "generated_at": now_utc_iso(), - "request": _request(time_range), - "error_code": _redact_text(error_code, limit=120), - "error": _redact_text(error), - "omissions": [ - "Raw/private failure details and local paths were intentionally omitted." - ], - "boundary": public_safe_boundary(), - } - try: - payload["projection_envelope"] = _risks_envelope( - status_payload or {}, - status_read_at=status_read_at, - host_poll_status="not_read", - host_poll_read_at=None, - host_poll_receipt_count=None, - host_poll_unreadable_count=0, - host_poll_unreadable_goal_refs=[], - source_rows_omitted=0, - shown_count=0, - available_count=0, - agent_id=None, - ) - except Exception: - pass - return payload - - -def _warning( - reason_code: str, - *, - source: str | None = None, - goal_id: str | None = None, - detail: object | None = None, - available_count: int | None = None, - inspected_count: int | None = None, -) -> dict[str, Any]: - warning: dict[str, Any] = { - "reason_code": _redact_text(reason_code, limit=120), - } - if source: - warning["source"] = _redact_text(source, limit=160) - if goal_id: - warning["goal_id"] = _redact_text(goal_id, limit=120) - if detail: - warning["detail"] = _redact_text(detail) - if available_count is not None: - warning["available_count"] = available_count - if inspected_count is not None: - warning["inspected_count"] = inspected_count - return warning - - -def _occurrence_id( - *, - source_surface: str, - source_index: int, - kind: str, - scope: str, - goal_id: str | None, -) -> str: - identity = { - "goal_id": goal_id, - "kind": kind, - "scope": scope, - "source_index": source_index, - "source_surface": source_surface, - } - encoded = json.dumps(identity, sort_keys=True, separators=(",", ":")).encode() - return hashlib.sha256(encoded).hexdigest()[:16] - - -def _severity(value: object, *, default: str = "warning") -> str: - normalized = str(value or "").strip() - if normalized == "error": - return "high" - if normalized in SEVERITY_RANK: - return normalized - return default - - -def _goal_ids_for_diagnostic( - diagnostic: dict[str, Any], - *, - scope: str, - warnings: list[dict[str, Any]], -) -> list[str | None]: - goal_id = str(diagnostic.get("goal_id") or "").strip() - if scope != "goals": - return [goal_id or None] - - goal_ids: list[str] = [] - raw_goal_ids = diagnostic.get("goal_ids") - if raw_goal_ids is not None and not isinstance(raw_goal_ids, list): - warnings.append( - _warning( - "malformed_contract_goal_ids", - source=_CONTRACT_SOURCE, - ) - ) - elif isinstance(raw_goal_ids, list): - for raw_goal_id in raw_goal_ids: - normalized = str(raw_goal_id or "").strip() - if normalized and normalized not in goal_ids: - goal_ids.append(normalized) - if goal_id and goal_id not in goal_ids: - goal_ids.append(goal_id) - if not goal_ids: - warnings.append( - _warning( - "contract_goal_identity_missing", - source=_CONTRACT_SOURCE, - ) - ) - return list(goal_ids) - - -def _contract_action(code: str) -> str: - if code == "public_boundary_violation": - return "Inspect and remove the boundary violation before delivery." - if code == "registry_boundary_risk": - return "Inspect and repair the registry boundary projection." - return f"Inspect and resolve contract check {code} before relying on this goal." - - -def _normalize_contract_diagnostic( - raw_diagnostic: object, - *, - source_index: int, - warnings: list[dict[str, Any]], -) -> list[dict[str, Any]]: - if not isinstance(raw_diagnostic, dict): - warnings.append( - _warning("malformed_contract_diagnostic", source=_CONTRACT_SOURCE) - ) - return [] - diagnostic: dict[str, Any] = raw_diagnostic - code = str(diagnostic.get("code") or "").strip() - if not code: - warnings.append( - _warning("contract_code_missing", source=_CONTRACT_SOURCE) - ) - return [] - scope = str(diagnostic.get("scope") or "global").strip() or "global" - category = "boundary_warning" if code in BOUNDARY_CODES else "failing_check" - rows: list[dict[str, Any]] = [] - for goal_id in _goal_ids_for_diagnostic( - diagnostic, - scope=scope, - warnings=warnings, - ): - occurrence_id = _occurrence_id( - source_surface=_CONTRACT_SOURCE, - source_index=source_index, - kind=code, - scope=scope, - goal_id=goal_id, - ) - rows.append( - { - "goal_id": _redact_text(goal_id, limit=120) or None, - "scope": _redact_text(scope, limit=120), - "category": category, - "kind": _redact_text(code, limit=120), - "severity": _severity(diagnostic.get("severity"), default="high"), - "summary": _redact_text(diagnostic.get("message")) - or f"Contract check {code} failed.", - "occurrence_id": occurrence_id, - "occurrence_count": 1, - "evidence_refs": [ - f"{_CONTRACT_SOURCE}:{code}:{occurrence_id}" - ], - "next_safe_action": _contract_action(code), - "requires_user_approval": False, - } - ) - return rows - - -def _normalize_registry_finding( - raw_finding: object, - *, - source_index: int, - warnings: list[dict[str, Any]], -) -> list[dict[str, Any]]: - if not isinstance(raw_finding, dict): - warnings.append( - _warning("malformed_registry_finding", source=_REGISTRY_SOURCE) - ) - return [] - finding: dict[str, Any] = raw_finding - severity = str(finding.get("severity") or "").strip() - if severity not in {"high", "action"}: - return [] - kind = str(finding.get("kind") or "").strip() - if not kind: - warnings.append(_warning("registry_kind_missing", source=_REGISTRY_SOURCE)) - return [] - goal_id = str(finding.get("goal_id") or "").strip() or None - scope = "goal" if goal_id else "global" - occurrence_id = _occurrence_id( - source_surface=_REGISTRY_SOURCE, - source_index=source_index, - kind=kind, - scope=scope, - goal_id=goal_id, - ) - next_safe_action = _redact_text(finding.get("recommended_action")) - if not next_safe_action: - next_safe_action = f"Inspect and resolve global registry finding {kind}." - return [ - { - "goal_id": _redact_text(goal_id, limit=120) or None, - "scope": scope, - "category": "failing_check", - "kind": _redact_text(kind, limit=120), - "severity": severity, - "summary": _redact_text(finding.get("message")) - or f"Global registry finding {kind} requires attention.", - "occurrence_id": occurrence_id, - "occurrence_count": 1, - "evidence_refs": [ - f"{_REGISTRY_SOURCE}:{kind}:{occurrence_id}" - ], - "next_safe_action": next_safe_action, - "requires_user_approval": False, - } - ] - - -def _valid_timestamp(value: object) -> str | None: - text = str(value or "").strip() - if not text: - return None - try: - datetime.fromisoformat(text.replace("Z", "+00:00")) - except ValueError: - return None - return text - - -def _collect_stale_host_poll_risks( - *, - registry_path: Path, - scan_limit: int, - warnings: list[dict[str, Any]], -) -> tuple[list[dict[str, Any]], str, int | None, int, int, list[str]]: - """Scan project-local host poll receipts for loops that died mid-wait.""" - - risks: list[dict[str, Any]] = [] - try: - registry_payload = load_registry(registry_path) - except FileNotFoundError: - return risks, "missing", None, 0, 0, [] - except (OSError, ValueError) as exc: - warnings.append( - _warning( - "host_poll_registry_unreadable", - source=_HOST_POLL_SOURCE, - detail=str(exc)[:200], - ) - ) - return risks, "unreadable", None, 0, 1, [] - goals = registry_payload.get("goals") if isinstance(registry_payload, dict) else None - if not isinstance(goals, list): - return risks, "unreadable", None, 0, 1, [] - receipt_count = 0 - unreadable_count = 0 - unreadable_goal_refs: list[str] = [] - inspected_goals = goals[:scan_limit] - for source_index, goal in enumerate(inspected_goals): - if not isinstance(goal, dict) or not goal.get("id"): - continue - state_path = resolve_goal_local_path( - goal.get("state_file"), - goal, - fallback_base=registry_path.parent, - ) - receipt_path = receipt_path_for_goal(goal, state_path) - observation = read_host_poll_receipt_observation( - receipt_path, - expected_goal_id=str(goal.get("id") or ""), - ) - read_status = observation.get("read_status") - if read_status == "missing": - continue - goal_ref = _redact_text(str(goal.get("id") or ""), limit=120) - if read_status != "read": - unreadable_count += 1 - if goal_ref and len(unreadable_goal_refs) < 8: - unreadable_goal_refs.append(goal_ref) - continue - receipt = observation.get("receipt") - if not isinstance(receipt, dict): - unreadable_count += 1 - if goal_ref and len(unreadable_goal_refs) < 8: - unreadable_goal_refs.append(goal_ref) - continue - receipt_count += 1 - raw_risk = stale_host_poll_risk(receipt) - if raw_risk is None: - continue - kind = "stale_host_poll" - goal_id = _redact_text(str(goal.get("id") or ""), limit=120) or None - reason = _redact_text(str(raw_risk.get("reason") or ""), limit=200) - risks.append( - { - "goal_id": goal_id, - "scope": "goal", - "category": "stale_run", - "kind": kind, - "severity": _severity("warning"), - "summary": ( - reason - or "Host polling went quiet while the loop expected continuation." - ), - "reason": reason or None, - "occurrence_id": _occurrence_id( - source_surface=_HOST_POLL_SOURCE, - source_index=source_index, - kind=kind, - scope="goal", - goal_id=goal_id, - ), - "occurrence_count": 1, - "evidence_refs": [ - f"{_HOST_POLL_SOURCE}:{kind}:{str(raw_risk.get('last_poll_at') or '')}" - ], - "next_safe_action": ( - "Check the host session and LoopX gates; restart the goal " - "worker or resume the bridge when the loop should continue." - ), - "requires_user_approval": True, - } - ) - return ( - risks, - "read", - receipt_count, - max(0, len(goals) - len(inspected_goals)), - unreadable_count, - unreadable_goal_refs, - ) - - -def _normalize_stale_warning( - raw_item: object, - *, - source_index: int, - warnings: list[dict[str, Any]], -) -> list[dict[str, Any]]: - if not isinstance(raw_item, dict): - warnings.append(_warning("malformed_attention_item", source=_STALE_SOURCE)) - return [] - item: dict[str, Any] = raw_item - raw_warning = item.get("stale_latest_run_warning") - if raw_warning is None: - return [] - if not isinstance(raw_warning, dict): - warnings.append(_warning("malformed_stale_warning", source=_STALE_SOURCE)) - return [] - stale_warning: dict[str, Any] = raw_warning - kind = str(stale_warning.get("kind") or "").strip() - if kind != "stale_latest_run_projection": - warnings.append(_warning("invalid_stale_warning_kind", source=_STALE_SOURCE)) - return [] - goal_id = str(item.get("goal_id") or "").strip() or None - scope = "goal" if goal_id else "global" - occurrence_id = _occurrence_id( - source_surface=_STALE_SOURCE, - source_index=source_index, - kind=kind, - scope=scope, - goal_id=goal_id, - ) - reason = _redact_text(stale_warning.get("reason"), limit=160) - row: dict[str, Any] = { - "goal_id": _redact_text(goal_id, limit=120) or None, - "scope": scope, - "category": "stale_run", - "kind": kind, - "severity": _severity(stale_warning.get("severity")), - "summary": reason or "Latest-run routing is stale relative to active state.", - "reason": reason or None, - "occurrence_id": occurrence_id, - "occurrence_count": 1, - "evidence_refs": [f"{_STALE_SOURCE}:{kind}:{occurrence_id}"], - "next_safe_action": "Run refresh-state before trusting latest-run routing.", - "requires_user_approval": False, - } - for field in ("latest_run_generated_at", "active_state_updated_at"): - timestamp = _valid_timestamp(stale_warning.get(field)) - if timestamp is None: - warnings.append( - _warning( - "invalid_stale_timestamp", - source=_STALE_SOURCE, - goal_id=goal_id, - detail=f"Structured stale warning has no valid {field}.", - ) - ) - else: - row[field] = timestamp - return [row] - - -def _bounded_rows( - rows: list[Any], - *, - source: str, - scan_limit: int, - warnings: list[dict[str, Any]], -) -> tuple[list[Any], bool]: - truncated = len(rows) > scan_limit - if truncated: - warnings.append( - _warning( - "source_rows_truncated", - source=source, - available_count=len(rows), - inspected_count=scan_limit, - ) - ) - return rows[:scan_limit], truncated - - -def _required_container( - status_payload: dict[str, Any], - key: str, + error: object, *, time_range: str = "24h", + error_code: str = "global_risks_unavailable", + status_payload: dict[str, Any] | None = None, + status_read_at: str | None = None, ) -> dict[str, Any]: - container = status_payload.get(key) - if not isinstance(container, dict): - raise ValueError(f"Required status projection {key} is missing or malformed.") - return container + observed_at = now_utc_iso() + try: + return effect_runtime_result("presentation.global_risks.project", { + "schema_version": "loopx_global_risks_read_v0", "observed_at": observed_at, + "limit": 8, "agent_id": None, "time_range": time_range, + "status": status_payload, "status_read_at": status_read_at, + "error": _redact_text(error), "error_code": error_code, + }) + except Exception: + # Node failure cannot render its own error; retain the public wire codec. + return { + "ok": False, "schema_version": "global_manager_command_response_v0", + "generated_at": observed_at, "request": _transport_error_request(time_range), + "error_code": _redact_text(error_code, limit=120), "error": _redact_text(error), + "omissions": ["Raw/private failure details and local paths were intentionally omitted."], + "boundary": public_safe_boundary(), + } -def _optional_source_list(container: dict[str, Any], key: str) -> list[Any]: - if key not in container: - return [] - value = container.get(key) - if not isinstance(value, list): - raise ValueError(f"Required status source list {key} is malformed.") - return value - - -def _goal_matches_agent(goal: dict[str, Any], *, agent_id: str) -> bool: - coordination = as_dict(goal.get("coordination")) - registered_agents = coordination.get("registered_agents") - if not isinstance(registered_agents, list): - raise ValueError("agent scope unavailable for goal") - return agent_id in normalize_registered_agents(registered_agents) - - -def _filter_for_agent( - risks: list[dict[str, Any]], - *, - status_payload: dict[str, Any], - agent_id: str | None, - scan_limit: int, - warnings: list[dict[str, Any]], -) -> tuple[list[dict[str, Any]], bool]: - if not agent_id: - return risks, False - run_history = status_payload.get("run_history") - if not isinstance(run_history, dict): - raise ValueError("compact run-history projection is missing or malformed") - history_goals = run_history.get("goals") - if not isinstance(history_goals, list): - raise ValueError("compact run-history goal list is missing or malformed") - bounded_goals, truncated = _bounded_rows( - history_goals, - source="status.run_history.goals", - scan_limit=scan_limit, - warnings=warnings, - ) - goals_by_id: dict[str, dict[str, Any]] = {} - for raw_goal in bounded_goals: - if not isinstance(raw_goal, dict): - continue - goal_id = str(raw_goal.get("id") or "").strip() - if goal_id and goal_id not in goals_by_id: - goals_by_id[goal_id] = raw_goal - - filtered: list[dict[str, Any]] = [] - for risk in risks: - goal_id = str(risk.get("goal_id") or "").strip() - if not goal_id: - filtered.append(risk) - continue - goal = goals_by_id.get(goal_id) - if goal is None: - raise ValueError(f"agent scope unavailable for goal {goal_id}") - if _goal_matches_agent(goal, agent_id=agent_id): - filtered.append(risk) - return filtered, truncated - - -def _positive_occurrence_count(value: object) -> int: - if isinstance(value, int) and not isinstance(value, bool) and value > 0: - return value - return 1 - - -def _aggregate_risks(risks: list[dict[str, Any]]) -> list[dict[str, Any]]: - aggregated: dict[tuple[str, str, str, str], dict[str, Any]] = {} - for risk in risks: - key = ( - str(risk.get("category") or ""), - str(risk.get("kind") or ""), - str(risk.get("goal_id") or ""), - str(risk.get("occurrence_id") or ""), - ) - existing = aggregated.get(key) - if existing is None: - row = dict(risk) - row["occurrence_count"] = _positive_occurrence_count( - risk.get("occurrence_count") - ) - row["evidence_refs"] = [ - str(item) - for item in as_list(risk.get("evidence_refs")) - if str(item) - ] - aggregated[key] = row - continue - existing["occurrence_count"] = _positive_occurrence_count( - existing.get("occurrence_count") - ) + _positive_occurrence_count(risk.get("occurrence_count")) - incoming_severity = str(risk.get("severity") or "") - existing_severity = str(existing.get("severity") or "") - if SEVERITY_RANK.get(incoming_severity, 4) < SEVERITY_RANK.get( - existing_severity, - 4, - ): - existing["severity"] = incoming_severity - evidence_refs = as_list(existing.get("evidence_refs")) - for evidence_ref in as_list(risk.get("evidence_refs")): - if evidence_ref not in evidence_refs: - evidence_refs.append(evidence_ref) - existing["evidence_refs"] = evidence_refs - return list(aggregated.values()) - - -def _risk_sort_key(risk: dict[str, Any]) -> tuple[int, int, int, str, str, str]: - goal_id = str(risk.get("goal_id") or "") - evidence_refs = as_list(risk.get("evidence_refs")) - first_evidence = str(evidence_refs[0]) if evidence_refs else "" - return ( - SEVERITY_RANK.get(str(risk.get("severity") or ""), 4), - CATEGORY_RANK.get(str(risk.get("category") or ""), 3), - 0 if not goal_id else 1, - goal_id, - str(risk.get("kind") or ""), - first_evidence, - ) - - -def _groups(risks: list[dict[str, Any]]) -> dict[str, list[dict[str, Any]]]: - return { - "stale_runs": [risk for risk in risks if risk.get("category") == "stale_run"], - "boundary_warnings": [ - risk for risk in risks if risk.get("category") == "boundary_warning" - ], - "failing_checks": [ - risk for risk in risks if risk.get("category") == "failing_check" - ], - "rollback_candidates": [], - } - - -def _risks_envelope( - status_payload: dict[str, Any], - *, - status_read_at: str | None, - host_poll_status: str, - host_poll_read_at: str | None, - host_poll_receipt_count: int | None, - host_poll_unreadable_count: int, - host_poll_unreadable_goal_refs: list[str], - source_rows_omitted: int, - host_poll_goals_omitted: int = 0, - shown_count: int, - available_count: int, - agent_id: str | None, -) -> dict[str, Any]: - global_registry = as_dict(status_payload.get("global_registry")) - status_envelope = as_dict(status_payload.get("projection_envelope")) - global_source = next( - ( - row - for row in as_list(status_envelope.get("sources")) - if isinstance(row, dict) and row.get("source_id") == "global_registry" - ), - {}, - ) - available = global_registry.get("available") is True - count = global_registry.get("global_goal_count") - expected = ( - count - if available and isinstance(count, int) and not isinstance(count, bool) - else None - ) - excluded = ( - int(global_registry.get("current_registry_excluded_goal_count") or 0) - if available - else 0 - ) - omitted = [] - if excluded: - omitted.append( - { - "reason": "outside_current_registry", - "count": excluded, - "refs": [ - str(ref) - for ref in as_list( - global_registry.get("current_registry_excluded_goal_ids") - )[:8] - ], - } - ) - if source_rows_omitted: - omitted.append( - {"reason": "source_rows_not_scanned", "count": source_rows_omitted} - ) - if host_poll_goals_omitted: - omitted.append( - { - "reason": "host_poll_goals_not_scanned", - "count": host_poll_goals_omitted, - } - ) - if host_poll_unreadable_count: - omitted.append( - { - "reason": "host_poll_receipts_unreadable", - "count": host_poll_unreadable_count, - "refs": host_poll_unreadable_goal_refs[:8], - } - ) - if status_payload and status_payload.get("ok") is not True: - omitted.append({"reason": "status_unavailable", "count": 1}) - contract = as_dict(status_payload.get("contract")) - queue = as_dict(status_payload.get("attention_queue")) - history = as_dict(status_payload.get("run_history")) - contract_read = isinstance(status_payload.get("contract"), dict) and isinstance( - contract.get("error_diagnostics", []), list - ) - queue_read = isinstance(status_payload.get("attention_queue"), dict) and isinstance( - queue.get("items", []), list - ) - sources = [ - source_fact( - "global_registry", - read_status=( - str(global_source.get("read_status") or "read") - if available - else str( - global_registry.get("read_status") - or ("missing" if status_read_at else "not_read") - ) - ), - last_read_at=global_source.get("last_read_at") - or (status_read_at if available else None), - item_count=expected, - ), - source_fact( - "status_contract", - read_status="read" if contract_read else "not_read", - last_read_at=status_read_at if contract_read else None, - item_count=( - len(as_list(contract.get("error_diagnostics"))) - if contract_read - else None - ), - ), - source_fact( - "attention_queue", - read_status="read" if queue_read else "not_read", - last_read_at=status_read_at if queue_read else None, - item_count=len(as_list(queue.get("items"))) if queue_read else None, - ), - source_fact( - "host_poll_receipts", - read_status=host_poll_status, - last_read_at=host_poll_read_at, - item_count=host_poll_receipt_count, - unreadable_count=host_poll_unreadable_count, - ), - *( - [] - if status_envelope - else [source_fact("status", read_status="not_read")] - ), - ] - if agent_id: - history_read = isinstance(history.get("goals"), list) - sources.append( - source_fact( - "agent_scope", - read_status="read" if history_read else "not_read", - last_read_at=status_read_at if history_read else None, - item_count=len(as_list(history.get("goals"))) if history else None, - ) - ) - return seal_projection_envelope( - projection="global_risks", - observed_at=now_utc_iso(), - sources=sources, - coverage={ - "scope": "global", - "expected_count": expected, - "included_count": ( - max(0, expected - excluded) if expected is not None else 0 - ), - "omitted": omitted, - "shown_count": shown_count, - "available_count": available_count, - }, - upstream=[status_envelope] if status_envelope else [], - ) - - -def _malformed_projection_error( - error: object, - *, - time_range: str, - status_payload: dict[str, Any] | None = None, - status_read_at: str | None = None, -) -> dict[str, Any]: - return build_global_risks_error( - error, - time_range=time_range, - error_code="malformed_status_projection", - status_payload=status_payload, - status_read_at=status_read_at, - ) - def build_global_risks( - *, - registry_path: Path, - runtime_root_override: str | None, - agent_id: str | None, - time_range: str, - limit: int, + *, registry_path: Path, runtime_root_override: str | None, + agent_id: str | None, time_range: str, limit: int, ) -> dict[str, Any]: - normalized_time_range = _normalize_time_range(time_range) - normalized_limit = min(max(1, limit), MAX_RESULT_LIMIT) - scan_limit = min(max(normalized_limit * 4, 40), MAX_SCAN_LIMIT) - try: - status_result: object = collect_status( - registry_path=registry_path, - runtime_root_override=runtime_root_override, - limit=scan_limit, - ) - except Exception as exc: - return build_global_risks_error( - exc, - time_range=normalized_time_range, - error_code="status_collection_unavailable", - ) - if not isinstance(status_result, dict): - return _malformed_projection_error( - "Global status payload is not an object.", - time_range=normalized_time_range, - ) - status_payload: dict[str, Any] = status_result - status_read_at = now_utc_iso() - try: - contract = _required_container(status_payload, "contract") - global_registry = _required_container(status_payload, "global_registry") - attention_queue = _required_container(status_payload, "attention_queue") - diagnostics = _optional_source_list(contract, "error_diagnostics") - findings = _optional_source_list(global_registry, "findings") - items = _optional_source_list(attention_queue, "items") - except ValueError as exc: - return _malformed_projection_error( - exc, - time_range=normalized_time_range, - status_payload=status_payload, - status_read_at=status_read_at, - ) - - warnings: list[dict[str, Any]] = [] - risks: list[dict[str, Any]] = [] - source_rows_truncated = False - bounded_diagnostics, truncated = _bounded_rows( - diagnostics, - source=_CONTRACT_SOURCE, - scan_limit=scan_limit, - warnings=warnings, - ) - source_rows_truncated = source_rows_truncated or truncated - for source_index, diagnostic in enumerate(bounded_diagnostics): - risks.extend( - _normalize_contract_diagnostic( - diagnostic, - source_index=source_index, - warnings=warnings, - ) - ) - - if global_registry.get("available") is False: - warnings.append( - _warning( - "global_registry_unavailable", - source="status.global_registry", - ) - ) - else: - bounded_findings, truncated = _bounded_rows( - findings, - source=_REGISTRY_SOURCE, - scan_limit=scan_limit, - warnings=warnings, - ) - source_rows_truncated = source_rows_truncated or truncated - for source_index, finding in enumerate(bounded_findings): - risks.extend( - _normalize_registry_finding( - finding, - source_index=source_index, - warnings=warnings, - ) - ) - - bounded_items, truncated = _bounded_rows( - items, - source=_STALE_SOURCE, - scan_limit=scan_limit, - warnings=warnings, - ) - source_rows_truncated = source_rows_truncated or truncated - for source_index, item in enumerate(bounded_items): - risks.extend( - _normalize_stale_warning( - item, - source_index=source_index, - warnings=warnings, - ) - ) - - ( - host_poll_risks, - host_poll_status, - host_poll_receipt_count, - host_poll_goals_omitted, - host_poll_unreadable_count, - host_poll_unreadable_goal_refs, - ) = _collect_stale_host_poll_risks( - registry_path=registry_path, - scan_limit=scan_limit, - warnings=warnings, - ) - host_poll_read_at = now_utc_iso() if host_poll_status == "read" else None - risks.extend(host_poll_risks) - source_rows_truncated = source_rows_truncated or host_poll_goals_omitted > 0 - - try: - risks, history_truncated = _filter_for_agent( - risks, - status_payload=status_payload, - agent_id=agent_id, - scan_limit=scan_limit, - warnings=warnings, - ) - except ValueError as exc: - return build_global_risks_error( - exc, - time_range=normalized_time_range, - error_code="agent_scope_unavailable", - status_payload=status_payload, - status_read_at=status_read_at, - ) - source_rows_truncated = source_rows_truncated or history_truncated - - aggregated = _aggregate_risks(risks) - aggregated.sort(key=_risk_sort_key) - retained = aggregated[:normalized_limit] - full_groups = _groups(aggregated) - retained_groups = _groups(retained) - matched_risk_count = len(aggregated) - returned_risk_count = len(retained) - warning_count = len(warnings) - return { - "ok": True, - "schema_version": SCHEMA_VERSION, - "generated_at": now_utc_iso(), - "request": _request(normalized_time_range), - "summary": { - "source_health_ok": status_payload.get("ok") is True, - "matched_risk_count": matched_risk_count, - "matched_occurrence_count": sum( - _positive_occurrence_count(risk.get("occurrence_count")) - for risk in aggregated - ), - "returned_risk_count": returned_risk_count, - "source_scan_limit": scan_limit, - "source_rows_truncated": source_rows_truncated, - "stale_run_count": len(full_groups["stale_runs"]), - "boundary_warning_count": len(full_groups["boundary_warnings"]), - "failing_check_count": len(full_groups["failing_checks"]), - "rollback_candidate_count": 0, - "rollback_candidates_overlap_risks": False, - "truncated": matched_risk_count > returned_risk_count, - "source_warning_count": warning_count, - "source_surfaces": SOURCE_SURFACES, - }, - "groups": retained_groups, - "risks": retained, - "source_warnings": warnings[:SOURCE_WARNING_LIMIT], - "source_warnings_truncated": warning_count > SOURCE_WARNING_LIMIT, - "projection_envelope": _risks_envelope( - status_payload, - status_read_at=status_read_at, - host_poll_status=host_poll_status, - host_poll_read_at=host_poll_read_at, - host_poll_receipt_count=host_poll_receipt_count, - host_poll_unreadable_count=host_poll_unreadable_count, - host_poll_unreadable_goal_refs=host_poll_unreadable_goal_refs, - source_rows_omitted=sum( - max( - 0, - int(warning.get("available_count") or 0) - - int(warning.get("inspected_count") or 0), - ) - for warning in warnings - if warning.get("reason_code") == "source_rows_truncated" - ), - host_poll_goals_omitted=host_poll_goals_omitted, - shown_count=returned_risk_count, - available_count=matched_risk_count, - agent_id=agent_id, - ), - "omissions": [dict(_ROLLBACK_OMISSION)], - "boundary": public_safe_boundary(), - } + # This bounds host IO to the existing source contract; TS owns result limits. + scan_limit = min(max(min(max(1, limit), 100) * 4, 40), 400) + try: + status = collect_status(registry_path=registry_path, + runtime_root_override=runtime_root_override, limit=scan_limit) + except Exception as exc: + return build_global_risks_error(exc, time_range=time_range, + error_code="status_collection_unavailable") + return effect_runtime_result("presentation.global_risks.project", { + "schema_version": "loopx_global_risks_read_v0", "observed_at": now_utc_iso(), + "limit": limit, "agent_id": agent_id, "time_range": time_range, + "status": status, "host_poll": _read_host_poll_sources(registry_path, scan_limit), + }) def _render_risk_line(risk: dict[str, Any]) -> str: diff --git a/loopx/semantics/vocabulary_v0.json b/loopx/semantics/vocabulary_v0.json index 160b95952d..a323c15546 100644 --- a/loopx/semantics/vocabulary_v0.json +++ b/loopx/semantics/vocabulary_v0.json @@ -1210,7 +1210,7 @@ "contexts": [ { "id": "global_risks", - "owner": "loopx/global_risks.py::SOURCE_SURFACES" + "owner": "loopx/control_plane/presentation/global_risk_read.ts::SOURCE_SURFACES" }, { "id": "global_todos", diff --git a/tests/control_plane_ts/global_risk_read.test.ts b/tests/control_plane_ts/global_risk_read.test.ts new file mode 100644 index 0000000000..d506bc35f5 --- /dev/null +++ b/tests/control_plane_ts/global_risk_read.test.ts @@ -0,0 +1,67 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import {aggregateGlobalRisks, projectGlobalRisks} from "../../loopx/control_plane/presentation/global_risk_read.ts"; +import {sealProjectionEnvelope} from "../../loopx/control_plane/projection_envelope.ts"; + +const NOW = "2026-11-02T12:00:00+00:00"; +const empty = () => ({ok: true, contract: {error_diagnostics: []}, + global_registry: {available: true, findings: [], global_goal_count: 1}, attention_queue: {items: []}}); +const input = () => ({schema_version: "loopx_global_risks_read_v0", observed_at: NOW, + limit: 8, agent_id: null, time_range: "24h", status: empty(), host_poll: {read_status: "missing"}}); + +test("aggregation preserves occurrence identity, raises severity and unions evidence in source order", () => { + const first = {goal_id: "goal-a", category: "failing_check", kind: "synthetic", severity: "warning", + occurrence_id: "0123456789abcdef", occurrence_count: 1, evidence_refs: ["first"]}; + const rows = aggregateGlobalRisks([first, {...first, severity: "high", evidence_refs: ["second", "first"]}, + {...first, occurrence_id: "fedcba9876543210", occurrence_count: false}]); + assert.equal(rows.length, 2); + assert.deepEqual(rows[0], {...first, severity: "high", occurrence_count: 2, evidence_refs: ["first", "second"]}); + assert.equal(rows[1].occurrence_count, 1); + assert.equal(first.severity, "warning"); +}); + +test("stale poll decisions require continuation and compare microsecond instants inclusively", () => { + for (const [stamp, gate, expected] of [ + ["2026-11-02T08:00:00Z", true, 1], ["2026-11-02T08:00:00.000001Z", true, 0], + ["2026-11-02T16:00:00+08:00", true, 1], ["2026-11-02T08:00:00", true, 1], + ["invalid", true, 0], ["2026-11-01T00:00:00Z", false, 0], ["2026-11-01T00:00:00Z", null, 0], + ]) { + const result = projectGlobalRisks({...input(), host_poll: {read_status: "read", goal_count: 1, + goals: [{goal: {id: "goal-a"}, observation: {read_status: "read", receipt: { + expected_continuation: gate, last_poll_at: stamp}}}]}}); + assert.equal((result.risks as unknown[]).length, expected, String(stamp)); + } +}); + +test("boundary rejects malformed request carriers before projection", () => { + for (const replacement of [{schema_version: "wrong"}, {observed_at: "invalid"}, {limit: true}, + {agent_id: []}, {time_range: 24}, {host_poll: null}]) { + assert.throws(() => projectGlobalRisks({...input(), ...replacement})); + } +}); + +test("upstream stale copy, unreadable receipts and omitted scope remain visible in the envelope", () => { + const upstream = sealProjectionEnvelope({schema_version: "loopx_projection_envelope_seal_request_v0", projection: "status", + observed_at: "2026-11-02T10:00:00+00:00", sources: [{source_id: "global_registry", read_status: "read", + last_read_at: "2026-11-02T10:00:00+00:00"}], coverage: {scope: "global", expected_count: 1, included_count: 1}}); + const result = projectGlobalRisks({...input(), status: {...empty(), projection_envelope: upstream}, + host_poll: {read_status: "read", goal_count: 41, goals: [{goal: {id: "goal-a"}, observation: {read_status: "unreadable"}}]}}); + const envelope = result.projection_envelope as Record; + assert.equal(envelope.alert, true); + const coverage = envelope.coverage as Record; + assert.equal(coverage.complete, false); + assert.match(JSON.stringify(envelope), /host_poll_receipts_unreadable/); + assert.match(JSON.stringify(envelope), /host_poll_goals_not_scanned/); + const replay = sealProjectionEnvelope({schema_version: "loopx_projection_envelope_serve_request_v0", envelope, + served_at: "2026-11-02T13:00:00+00:00"}); + assert.equal(replay.observed_at, NOW); + assert.equal(replay.served_from_cache, true); +}); + +test("agent scope failure returns an error without certifying a successful filtered read", () => { + const result = projectGlobalRisks({...input(), agent_id: "agent-a", status: {...empty(), + contract: {error_diagnostics: [{code: "synthetic", scope: "goal", goal_id: "goal-a"}]}}}); + assert.equal(result.ok, false); + assert.equal(result.error_code, "agent_scope_unavailable"); + assert.equal(result.groups, undefined); +}); diff --git a/tests/fixtures/global_risks_transaction.json b/tests/fixtures/global_risks_transaction.json new file mode 100644 index 0000000000..10b74d35f5 --- /dev/null +++ b/tests/fixtures/global_risks_transaction.json @@ -0,0 +1,187 @@ +{ + "empty": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "single": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":1,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- severity=`warning` goal=`goal-a` kind=`synthetic_check` occurrence=`898dffc3ba85fe47` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "multiple": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:3407ca20c0d51413\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"3407ca20c0d51413\",\"requires_user_approval\":false,\"scope\":\"goals\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:3511caf336f1534e\"],\"goal_id\":\"goal-b\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"3511caf336f1534e\",\"requires_user_approval\":false,\"scope\":\"goals\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":2,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":2,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:3407ca20c0d51413\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"3407ca20c0d51413\",\"requires_user_approval\":false,\"scope\":\"goals\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:3511caf336f1534e\"],\"goal_id\":\"goal-b\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"3511caf336f1534e\",\"requires_user_approval\":false,\"scope\":\"goals\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":2,\"matched_occurrence_count\":2,\"matched_risk_count\":2,\"returned_risk_count\":2,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `2`\n- returned: `2`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- severity=`warning` goal=`goal-a` kind=`synthetic_check` occurrence=`3407ca20c0d51413` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:3407ca20c0d51413. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n- severity=`warning` goal=`goal-b` kind=`synthetic_check` occurrence=`3511caf336f1534e` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:3511caf336f1534e. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "duplicate_and_severity": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:093d6a0e38103be6\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"093d6a0e38103be6\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"high\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:f0ca234a00c8a342\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"f0ca234a00c8a342\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":3,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":3,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":3,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:093d6a0e38103be6\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"093d6a0e38103be6\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"high\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:f0ca234a00c8a342\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"f0ca234a00c8a342\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":3,\"matched_occurrence_count\":3,\"matched_risk_count\":3,\"returned_risk_count\":3,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `3`\n- returned: `3`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- severity=`high` goal=`goal-a` kind=`synthetic_check` occurrence=`093d6a0e38103be6` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:093d6a0e38103be6. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n- severity=`warning` goal=`goal-a` kind=`synthetic_check` occurrence=`898dffc3ba85fe47` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n- severity=`warning` goal=`goal-a` kind=`synthetic_check` occurrence=`f0ca234a00c8a342` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:f0ca234a00c8a342. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "redaction": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Inspect and /loopx-global-risks. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx…\"}],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Inspect and /loopx-global-risks. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx…\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":1,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- severity=`warning` goal=`goal-a` kind=`synthetic_check` occurrence=`898dffc3ba85fe47` count=`1` approval=`False`: Inspect and /loopx-global-risks. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx… evidence=status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "truncation": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:7e5bd80372e85e44\"],\"goal_id\":\"goal-0\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"7e5bd80372e85e44\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":false,\"coverage\":{\"available_count\":40,\"complete\":false,\"expected_count\":2,\"included_count\":2,\"omitted\":[{\"count\":5,\"reason\":\"source_rows_not_scanned\",\"refs\":[]}],\"scope\":\"global\",\"shown_count\":1,\"truncated\":true},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":45,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:7e5bd80372e85e44\"],\"goal_id\":\"goal-0\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"7e5bd80372e85e44\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[{\"available_count\":45,\"inspected_count\":40,\"reason_code\":\"source_rows_truncated\",\"source\":\"status.contract.error_diagnostics\"}],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":40,\"matched_occurrence_count\":40,\"matched_risk_count\":40,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":true,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":1,\"stale_run_count\":0,\"truncated\":true}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `40`\n- returned: `1`\n- truncated: `True`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global` shown=`1/40`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources` sources=`status` omitted=`source_rows_not_scanned=5`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- severity=`warning` goal=`goal-0` kind=`synthetic_check` occurrence=`7e5bd80372e85e44` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:7e5bd80372e85e44. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n\n## Rollback Candidates\n- None.\n\n## Source Warnings\n- `source_rows_truncated` source=`status.contract.error_diagnostics` available=`45` inspected=`40`\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "limit_zero": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "limit_max": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":400,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "malformed_rows": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":3,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[{\"reason_code\":\"malformed_contract_diagnostic\",\"source\":\"status.contract.error_diagnostics\"},{\"reason_code\":\"contract_code_missing\",\"source\":\"status.contract.error_diagnostics\"},{\"reason_code\":\"malformed_contract_goal_ids\",\"source\":\"status.contract.error_diagnostics\"},{\"reason_code\":\"contract_goal_identity_missing\",\"source\":\"status.contract.error_diagnostics\"}],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":4,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Source Warnings\n- `malformed_contract_diagnostic` source=`status.contract.error_diagnostics`\n- `contract_code_missing` source=`status.contract.error_diagnostics`\n- `malformed_contract_goal_ids` source=`status.contract.error_diagnostics`\n- `contract_goal_identity_missing` source=`status.contract.error_diagnostics`\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "stale_warning": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"status.attention_queue.items.stale_latest_run_warning:stale_latest_run_projection:be7d46bd66a78715\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_latest_run_projection\",\"latest_run_generated_at\":\"2026-11-01\",\"next_safe_action\":\"Run refresh-state before trusting latest-run routing.\",\"occurrence_count\":1,\"occurrence_id\":\"be7d46bd66a78715\",\"reason\":\"Synthetic stale routing.\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic stale routing.\"}]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"status.attention_queue.items.stale_latest_run_warning:stale_latest_run_projection:be7d46bd66a78715\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_latest_run_projection\",\"latest_run_generated_at\":\"2026-11-01\",\"next_safe_action\":\"Run refresh-state before trusting latest-run routing.\",\"occurrence_count\":1,\"occurrence_id\":\"be7d46bd66a78715\",\"reason\":\"Synthetic stale routing.\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic stale routing.\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[{\"detail\":\"Structured stale warning has no valid active_state_updated_at.\",\"goal_id\":\"goal-a\",\"reason_code\":\"invalid_stale_timestamp\",\"source\":\"status.attention_queue.items.stale_latest_run_warning\"}],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":1,\"stale_run_count\":1,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- severity=`warning` goal=`goal-a` kind=`stale_latest_run_projection` occurrence=`be7d46bd66a78715` count=`1` approval=`False`: Synthetic stale routing. evidence=status.attention_queue.items.stale_latest_run_warning:stale_latest_run_projection:be7d46bd66a78715. Next: Run refresh-state before trusting latest-run routing.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Source Warnings\n- `invalid_stale_timestamp` source=`status.attention_queue.items.stale_latest_run_warning` goal=`goal-a`: Structured stale warning has no valid active_state_updated_at.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "malformed_items": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":3,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[{\"reason_code\":\"malformed_attention_item\",\"source\":\"status.attention_queue.items.stale_latest_run_warning\"},{\"reason_code\":\"malformed_stale_warning\",\"source\":\"status.attention_queue.items.stale_latest_run_warning\"},{\"reason_code\":\"invalid_stale_warning_kind\",\"source\":\"status.attention_queue.items.stale_latest_run_warning\"}],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":3,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Source Warnings\n- `malformed_attention_item` source=`status.attention_queue.items.stale_latest_run_warning`\n- `malformed_stale_warning` source=`status.attention_queue.items.stale_latest_run_warning`\n- `invalid_stale_warning_kind` source=`status.attention_queue.items.stale_latest_run_warning`\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "registry_findings": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.global_registry.findings:synthetic_registry:dd940546cf47f931\"],\"goal_id\":null,\"kind\":\"synthetic_registry\",\"next_safe_action\":\"Inspect and resolve global registry finding synthetic_registry.\",\"occurrence_count\":1,\"occurrence_id\":\"dd940546cf47f931\",\"requires_user_approval\":false,\"scope\":\"global\",\"severity\":\"action\",\"summary\":\"Global registry finding synthetic_registry requires attention.\"}],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.global_registry.findings:synthetic_registry:dd940546cf47f931\"],\"goal_id\":null,\"kind\":\"synthetic_registry\",\"next_safe_action\":\"Inspect and resolve global registry finding synthetic_registry.\",\"occurrence_count\":1,\"occurrence_id\":\"dd940546cf47f931\",\"requires_user_approval\":false,\"scope\":\"global\",\"severity\":\"action\",\"summary\":\"Global registry finding synthetic_registry requires attention.\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[{\"reason_code\":\"malformed_registry_finding\",\"source\":\"status.global_registry.findings\"},{\"reason_code\":\"registry_kind_missing\",\"source\":\"status.global_registry.findings\"}],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":1,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":2,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- severity=`action` goal=`global` kind=`synthetic_registry` occurrence=`dd940546cf47f931` count=`1` approval=`False`: Global registry finding synthetic_registry requires attention. evidence=status.global_registry.findings:synthetic_registry:dd940546cf47f931. Next: Inspect and resolve global registry finding synthetic_registry.\n\n## Rollback Candidates\n- None.\n\n## Source Warnings\n- `malformed_registry_finding` source=`status.global_registry.findings`\n- `registry_kind_missing` source=`status.global_registry.findings`\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "agent_filter": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:98a56e46625a17f8\"],\"goal_id\":null,\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"98a56e46625a17f8\",\"requires_user_approval\":false,\"scope\":\"global\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":2,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":2,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":3,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"agent_scope\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:98a56e46625a17f8\"],\"goal_id\":null,\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"98a56e46625a17f8\",\"requires_user_approval\":false,\"scope\":\"global\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"},{\"category\":\"failing_check\",\"evidence_refs\":[\"status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47\"],\"goal_id\":\"goal-a\",\"kind\":\"synthetic_check\",\"next_safe_action\":\"Inspect and resolve contract check synthetic_check before relying on this goal.\",\"occurrence_count\":1,\"occurrence_id\":\"898dffc3ba85fe47\",\"requires_user_approval\":false,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"Synthetic check failed.\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":2,\"matched_occurrence_count\":2,\"matched_risk_count\":2,\"returned_risk_count\":2,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `2`\n- returned: `2`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`5/6` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- severity=`warning` goal=`global` kind=`synthetic_check` occurrence=`98a56e46625a17f8` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:98a56e46625a17f8. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n- severity=`warning` goal=`goal-a` kind=`synthetic_check` occurrence=`898dffc3ba85fe47` count=`1` approval=`False`: Synthetic check failed. evidence=status.contract.error_diagnostics:synthetic_check:898dffc3ba85fe47. Next: Inspect and resolve contract check synthetic_check before relying on this goal.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "agent_failure": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"error\":\"compact run-history projection is missing or malformed\",\"error_code\":\"agent_scope_unavailable\",\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"ok\":false,\"omissions\":[\"Raw/private failure details and local paths were intentionally omitted.\"],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"host_poll_receipts\",\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"schema_version\":\"global_manager_command_response_v0\"}", + "markdown": "# LoopX Global Risks Unavailable\n\n- ok: `False`\n- error_code: `agent_scope_unavailable`\n- error: compact run-history projection is missing or malformed\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`3/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`host_poll_receipts,status` omitted=`-`; state this before treating the projection as current or whole\n\n## Omissions\n- Raw/private failure details and local paths were intentionally omitted.", + "crossings": 1 + }, + "status_nonobject": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"error\":\"Global status payload is not an object.\",\"error_code\":\"malformed_status_projection\",\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"ok\":false,\"omissions\":[\"Raw/private failure details and local paths were intentionally omitted.\"],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\"],\"alert_source_ids\":[\"global_registry\",\"status_contract\",\"attention_queue\",\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":null,\"included_count\":0,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"schema_version\":\"global_manager_command_response_v0\"}", + "markdown": "# LoopX Global Risks Unavailable\n\n- ok: `False`\n- error_code: `malformed_status_projection`\n- error: Global status payload is not an object.\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`0/5` coverage=`0/None` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources` sources=`global_registry,status_contract,attention_queue,host_poll_receipts,status` omitted=`-`; state this before treating the projection as current or whole\n\n## Omissions\n- Raw/private failure details and local paths were intentionally omitted.", + "crossings": 1 + }, + "status_missing": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"error\":\"Required status projection contract is missing or malformed.\",\"error_code\":\"malformed_status_projection\",\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"ok\":false,\"omissions\":[\"Raw/private failure details and local paths were intentionally omitted.\"],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\"],\"alert_source_ids\":[\"global_registry\",\"status_contract\",\"attention_queue\",\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":null,\"included_count\":0,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":true,\"alert_reasons\":[\"missing\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"missing\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"missing\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"schema_version\":\"global_manager_command_response_v0\"}", + "markdown": "# LoopX Global Risks Unavailable\n\n- ok: `False`\n- error_code: `malformed_status_projection`\n- error: Required status projection contract is missing or malformed.\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`0/5` coverage=`0/None` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources` sources=`global_registry,status_contract,attention_queue,host_poll_receipts,status` omitted=`-`; state this before treating the projection as current or whole\n\n## Omissions\n- Raw/private failure details and local paths were intentionally omitted.", + "crossings": 1 + }, + "status_bad_list": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"error\":\"Required status source list error_diagnostics is malformed.\",\"error_code\":\"malformed_status_projection\",\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"ok\":false,\"omissions\":[\"Raw/private failure details and local paths were intentionally omitted.\"],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status_contract\",\"host_poll_receipts\",\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"schema_version\":\"global_manager_command_response_v0\"}", + "markdown": "# LoopX Global Risks Unavailable\n\n- ok: `False`\n- error_code: `malformed_status_projection`\n- error: Required status source list error_diagnostics is malformed.\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`2/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status_contract,host_poll_receipts,status` omitted=`-`; state this before treating the projection as current or whole\n\n## Omissions\n- Raw/private failure details and local paths were intentionally omitted.", + "crossings": 1 + }, + "status_exception": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"error\":\"Synthetic source unavailable.\",\"error_code\":\"status_collection_unavailable\",\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"ok\":false,\"omissions\":[\"Raw/private failure details and local paths were intentionally omitted.\"],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\"],\"alert_source_ids\":[\"global_registry\",\"status_contract\",\"attention_queue\",\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":null,\"included_count\":0,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"schema_version\":\"global_manager_command_response_v0\"}", + "markdown": "# LoopX Global Risks Unavailable\n\n- ok: `False`\n- error_code: `status_collection_unavailable`\n- error: Synthetic source unavailable.\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`0/5` coverage=`0/None` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources` sources=`global_registry,status_contract,attention_queue,host_poll_receipts,status` omitted=`-`; state this before treating the projection as current or whole\n\n## Omissions\n- Raw/private failure details and local paths were intentionally omitted.", + "crossings": 1 + }, + "registry_unreadable": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\",\"unreadable_sources\"],\"alert_source_ids\":[\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":2,\"included_count\":2,\"omitted\":[{\"count\":1,\"reason\":\"host_poll_receipts_unreadable\",\"refs\":[]}],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"unreadable\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"unreadable\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"unreadable\",\"unreadable_count\":1,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[{\"detail\":\"Synthetic registry unavailable.\",\"reason_code\":\"host_poll_registry_unreadable\",\"source\":\"project.host_poll_receipts\"}],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":1,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`3/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources,unreadable_sources` sources=`host_poll_receipts,status` omitted=`host_poll_receipts_unreadable=1`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Source Warnings\n- `host_poll_registry_unreadable` source=`project.host_poll_receipts`: Synthetic registry unavailable.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "registry_malformed": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\",\"unreadable_sources\"],\"alert_source_ids\":[\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":2,\"included_count\":2,\"omitted\":[{\"count\":1,\"reason\":\"host_poll_receipts_unreadable\",\"refs\":[]}],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"unreadable\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"unreadable\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"unreadable\",\"unreadable_count\":1,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`3/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources,unreadable_sources` sources=`host_poll_receipts,status` omitted=`host_poll_receipts_unreadable=1`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "error": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"error\":\"Synthetic unavailable.\",\"error_code\":\"global_risks_unavailable\",\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"ok\":false,\"omissions\":[\"Raw/private failure details and local paths were intentionally omitted.\"],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\"],\"alert_source_ids\":[\"global_registry\",\"status_contract\",\"attention_queue\",\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":null,\"included_count\":0,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"schema_version\":\"global_manager_command_response_v0\"}", + "markdown": "# LoopX Global Risks Unavailable\n\n- ok: `False`\n- error_code: `global_risks_unavailable`\n- error: Synthetic unavailable.\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`0/5` coverage=`0/None` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources` sources=`global_registry,status_contract,attention_queue,host_poll_receipts,status` omitted=`-`; state this before treating the projection as current or whole\n\n## Omissions\n- Raw/private failure details and local paths were intentionally omitted.", + "crossings": 1 + }, + "error_code": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"error\":\"Synthetic failure.\",\"error_code\":\"synthetic_unavailable\",\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"ok\":false,\"omissions\":[\"Raw/private failure details and local paths were intentionally omitted.\"],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\"],\"alert_source_ids\":[\"global_registry\",\"status_contract\",\"attention_queue\",\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":null,\"included_count\":0,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"schema_version\":\"global_manager_command_response_v0\"}", + "markdown": "# LoopX Global Risks Unavailable\n\n- ok: `False`\n- error_code: `synthetic_unavailable`\n- error: Synthetic failure.\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`0/5` coverage=`0/None` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources` sources=`global_registry,status_contract,attention_queue,host_poll_receipts,status` omitted=`-`; state this before treating the projection as current or whole\n\n## Omissions\n- Raw/private failure details and local paths were intentionally omitted.", + "crossings": 1 + }, + "poll_fresh": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_stale": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-01T12:00:00Z\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-01T12:00:00Z\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":1,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- severity=`warning` goal=`goal-a` kind=`stale_host_poll` occurrence=`dada093d6515196f` count=`1` approval=`True`: The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti… evidence=project.host_poll_receipts:stale_host_poll:2026-11-01T12:00:00Z. Next: Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_edge": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-02T08:00:00Z\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-02T08:00:00Z\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":1,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- severity=`warning` goal=`goal-a` kind=`stale_host_poll` occurrence=`dada093d6515196f` count=`1` approval=`True`: The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti… evidence=project.host_poll_receipts:stale_host_poll:2026-11-02T08:00:00Z. Next: Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_before_edge": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_timezone": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-02T16:00:00+08:00\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-02T16:00:00+08:00\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":1,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- severity=`warning` goal=`goal-a` kind=`stale_host_poll` occurrence=`dada093d6515196f` count=`1` approval=`True`: The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti… evidence=project.host_poll_receipts:stale_host_poll:2026-11-02T16:00:00+08:00. Next: Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_naive": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-02T08:00:00\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":1,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":1,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[{\"category\":\"stale_run\",\"evidence_refs\":[\"project.host_poll_receipts:stale_host_poll:2026-11-02T08:00:00\"],\"goal_id\":\"goal-a\",\"kind\":\"stale_host_poll\",\"next_safe_action\":\"Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\",\"occurrence_count\":1,\"occurrence_id\":\"dada093d6515196f\",\"reason\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\",\"requires_user_approval\":true,\"scope\":\"goal\",\"severity\":\"warning\",\"summary\":\"The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti…\"}],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":1,\"matched_risk_count\":1,\"returned_risk_count\":1,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":1,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `1`\n- returned: `1`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- severity=`warning` goal=`goal-a` kind=`stale_host_poll` occurrence=`dada093d6515196f` count=`1` approval=`True`: The host loop polled quota while expecting continuation but has gone quiet for longer than the staleness window. The driver may have died mid-wait, or the loop may have been paused or stopped intenti… evidence=project.host_poll_receipts:stale_host_poll:2026-11-02T08:00:00. Next: Check the host session and LoopX gates; restart the goal worker or resume the bridge when the loop should continue.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_malformed": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\",\"unreadable_sources\"],\"alert_source_ids\":[\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":2,\"included_count\":2,\"omitted\":[{\"count\":1,\"reason\":\"host_poll_receipts_unreadable\",\"refs\":[\"goal-a\"]}],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"partially_unreadable\"],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":1,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources,unreadable_sources` sources=`host_poll_receipts,status` omitted=`host_poll_receipts_unreadable=1`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_stopped": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":1,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "poll_no_gate": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"incomplete_coverage\",\"missing_required_sources\",\"unreadable_sources\"],\"alert_source_ids\":[\"host_poll_receipts\",\"status\"],\"complete\":false,\"coverage\":{\"available_count\":0,\"complete\":false,\"expected_count\":2,\"included_count\":2,\"omitted\":[{\"count\":1,\"reason\":\"host_poll_receipts_unreadable\",\"refs\":[\"goal-a\"]}],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"partially_unreadable\"],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":1,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `incomplete_coverage,missing_required_sources,unreadable_sources` sources=`host_poll_receipts,status` omitted=`host_poll_receipts_unreadable=1`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "range_' 2D '": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"2d\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `2d`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "range_'001h'": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"001h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `001h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "range_'0h'": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "range_'bad'": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "range_''": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"24h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `24h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + }, + "range_'48h'": { + "json": "{\"boundary\":{\"absolute_paths_recorded\":false,\"credential_values_recorded\":false,\"private_source_bodies_recorded\":false,\"raw_connector_payloads_recorded\":false,\"raw_logs_recorded\":false,\"raw_transcripts_recorded\":false},\"generated_at\":\"2026-11-02T12:00:00+00:00\",\"groups\":{\"boundary_warnings\":[],\"failing_checks\":[],\"rollback_candidates\":[],\"stale_runs\":[]},\"ok\":true,\"omissions\":[{\"kind\":\"rollback_candidate_source_unavailable\",\"reason\":\"Current projections do not carry rollback trigger and causal linkage.\"}],\"projection_envelope\":{\"age_seconds\":0,\"alert\":true,\"alert_reasons\":[\"missing_required_sources\"],\"alert_source_ids\":[\"status\"],\"complete\":true,\"coverage\":{\"available_count\":0,\"complete\":true,\"expected_count\":2,\"included_count\":2,\"omitted\":[],\"scope\":\"global\",\"shown_count\":0,\"truncated\":false},\"fresh\":false,\"observed_at\":\"2026-11-02T12:00:00+00:00\",\"projection\":\"global_risks\",\"schema_version\":\"loopx_projection_envelope_v0\",\"served_at\":\"2026-11-02T12:00:00+00:00\",\"served_from_cache\":false,\"sources\":[{\"alert\":false,\"alert_reasons\":[],\"item_count\":2,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"global_registry\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"status_contract\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"attention_queue\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":false,\"alert_reasons\":[],\"item_count\":0,\"last_read_at\":\"2026-11-02T12:00:00+00:00\",\"missing_count\":0,\"read_status\":\"read\",\"required\":true,\"source_id\":\"host_poll_receipts\",\"source_updated_at\":null,\"staleness_seconds\":0,\"status\":\"fresh\",\"unreadable_count\":0,\"window_seconds\":300},{\"alert\":true,\"alert_reasons\":[\"not_read\"],\"item_count\":null,\"last_read_at\":null,\"missing_count\":0,\"read_status\":\"not_read\",\"required\":true,\"source_id\":\"status\",\"source_updated_at\":null,\"staleness_seconds\":null,\"status\":\"not_read\",\"unreadable_count\":0,\"window_seconds\":300}],\"upstream\":[]},\"request\":{\"cli_command\":\"loopx global-risks\",\"command\":\"/loopx-global-risks\",\"dry_run\":true,\"include\":[\"stale_runs\",\"boundary_warnings\",\"failing_checks\",\"rollback_candidates\"],\"legacy_aliases\":[\"/loop-global-risks\"],\"privacy_mode\":\"public_safe_summary\",\"schema_version\":\"global_manager_command_request_v0\",\"time_range\":\"48h\"},\"risks\":[],\"schema_version\":\"global_manager_command_response_v0\",\"source_warnings\":[],\"source_warnings_truncated\":false,\"summary\":{\"boundary_warning_count\":0,\"failing_check_count\":0,\"matched_occurrence_count\":0,\"matched_risk_count\":0,\"returned_risk_count\":0,\"rollback_candidate_count\":0,\"rollback_candidates_overlap_risks\":false,\"source_health_ok\":true,\"source_rows_truncated\":false,\"source_scan_limit\":40,\"source_surfaces\":[\"status contract diagnostics\",\"global registry health findings\",\"status attention queue stale-run warnings\",\"status compact run-history coordination\"],\"source_warning_count\":0,\"stale_run_count\":0,\"truncated\":false}}", + "markdown": "# LoopX Global Risks\n\n- command: `/loopx-global-risks`\n- time_range: `48h`\n- matched: `0`\n- returned: `0`\n- truncated: `False`\n- projection: 🔴 envelope=`loopx_projection_envelope_v0` observed_at=`2026-11-02T12:00:00+00:00` age=`0s` sources_fresh=`4/5` coverage=`2/2` scope=`global`\n- 🔴 projection alerts: `missing_required_sources` sources=`status` omitted=`-`; state this before treating the projection as current or whole\n\nNo current accepted source proves a rollback candidate; the rollback group is intentionally empty.\nThis read-only report does not authorize rollback, history rewrite, external cleanup, or merge.\n\n## Stale Runs\n- None.\n\n## Boundary Warnings\n- None.\n\n## Failing Checks\n- None.\n\n## Rollback Candidates\n- None.\n\n## Boundary\n- Raw/private material omitted; local paths are not recorded.", + "crossings": 1 + } +} diff --git a/tests/test_global_risks.py b/tests/test_global_risks.py index 51fe162e30..ffec8e101f 100644 --- a/tests/test_global_risks.py +++ b/tests/test_global_risks.py @@ -546,42 +546,6 @@ def test_malformed_history_container_fails_only_with_agent_filter( assert len(unfiltered["risks"]) == 1 -def test_aggregation_merges_only_identical_occurrences() -> None: - first = { - "goal_id": "goal-1", - "category": "failing_check", - "kind": "same-check", - "severity": "warning", - "summary": "First copy.", - "occurrence_id": "0123456789abcdef", - "occurrence_count": 1, - "evidence_refs": ["status.contract:first"], - "next_safe_action": "Inspect the check.", - "requires_user_approval": False, - } - duplicate = { - **first, - "severity": "high", - "occurrence_count": 1, - "evidence_refs": ["status.contract:second"], - } - distinct = {**first, "occurrence_id": "fedcba9876543210"} - - aggregated = global_risks._aggregate_risks([first, duplicate, distinct]) - - assert len(aggregated) == 2 - merged = next( - row for row in aggregated if row["occurrence_id"] == "0123456789abcdef" - ) - assert merged["occurrence_count"] == 2 - assert merged["severity"] == "high" - assert merged["evidence_refs"] == [ - "status.contract:first", - "status.contract:second", - ] - assert sum(row["occurrence_count"] for row in aggregated) == 3 - - def test_counts_and_groups_are_computed_before_and_after_limit( monkeypatch, tmp_path, @@ -756,8 +720,8 @@ def raise_status(**_kwargs: Any) -> object: def test_global_risks_error_survives_projection_runtime_failure(monkeypatch) -> None: monkeypatch.setattr( global_risks, - "seal_projection_envelope", - lambda **_: (_ for _ in ()).throw(RuntimeError("runtime unavailable")), + "effect_runtime_result", + lambda *_args, **_: (_ for _ in ()).throw(RuntimeError("runtime unavailable")), ) payload = global_risks.build_global_risks_error("status unavailable") diff --git a/tests/test_global_risks_path_pattern_parity.py b/tests/test_global_risks_path_pattern_parity.py new file mode 100644 index 0000000000..9913f4c5a3 --- /dev/null +++ b/tests/test_global_risks_path_pattern_parity.py @@ -0,0 +1,55 @@ +"""Keep the cross-runtime public path boundary tied to its canonical owner.""" + +import json +import re +import shutil +import subprocess +from pathlib import Path + +import pytest + +from loopx.presentation.public_safety import LOCAL_PATH_PATTERNS +from loopx.public_safe_text import PRESENTATION_LOCAL_PATH_PATTERNS + + +def test_global_risks_path_patterns_match_python_owner() -> None: + node = shutil.which("node") + if not node: + pytest.skip("Node.js is required for global-risk path pattern parity") + root = Path(__file__).resolve().parents[1] + result = subprocess.run( + [ + node, "--no-warnings", "--experimental-strip-types", "--input-type=module", + "-e", + "import {LOCAL_PATH_PATTERNS} from " + "'./loopx/control_plane/presentation/global_risk_read.ts';" + "console.log(JSON.stringify(LOCAL_PATH_PATTERNS.map(" + "pattern => [pattern.source, pattern.flags])));", + ], + cwd=root, check=True, capture_output=True, text=True, + ) + assert LOCAL_PATH_PATTERNS is PRESENTATION_LOCAL_PATH_PATTERNS + expected = [] + for pattern in PRESENTATION_LOCAL_PATH_PATTERNS: + assert not pattern.flags & ~(re.UNICODE | re.IGNORECASE) + source = pattern.pattern + ignore_case = bool(pattern.flags & re.IGNORECASE) + # JS uses whole-pattern i for Python's scoped Windows keyword folding. + # Everything else in those patterns is punctuation or already both-case + # ASCII classes. Only these known scoped groups are equivalent here. + for scoped, plain in ( + (r"(?i:UNC)", "UNC"), + (r"(?i:Volume)", "Volume"), + (r"(?i:GLOBALROOT\\Device\\)", r"GLOBALROOT\\Device\\"), + ): + if scoped in source: + source = source.replace(scoped, plain) + ignore_case = True + # Python raw strings escape quotes; JS regex literals escape slashes. + source = source.replace(r'\"', '"') + expected.append([source, "i" if ignore_case else ""]) + actual = [] + for source, flags in json.loads(result.stdout): + # g implements repeated substitution; u is JS's Unicode parsing mode. + actual.append([re.sub(r"(? None: - now = datetime(2026, 8, 13, 10, 0, 0, tzinfo=timezone.utc) - stale = { - "schema_version": HOST_POLL_RECEIPT_SCHEMA_VERSION, - "goal_id": "goal-1", - "agent_id": "agent-1", - "poll_count": 7, - "last_poll_at": (now - timedelta(hours=6)).isoformat(), - "expected_continuation": True, - } - risk = stale_host_poll_risk(stale, now=now) - assert risk is not None - assert risk["kind"] == "stale_host_poll" - assert risk["age_minutes"] == 360.0 - fresh = {**stale, "last_poll_at": (now - timedelta(minutes=5)).isoformat()} - assert stale_host_poll_risk(fresh, now=now) is None - stopped = {**stale, "expected_continuation": False} - assert stale_host_poll_risk(stopped, now=now) is None - assert stale_host_poll_risk({"expected_continuation": True, "last_poll_at": "not-a-date"}, now=now) is None - - def test_worker_observations_survive_polls_and_only_their_agent_can_clear(tmp_path): goal, state = {"id": "goal-1"}, tmp_path / "state.md" runtime = tmp_path / "runtime"