Files
AskaEth f91a83ff81
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled
feat(urgency): 通用紧急度通道(Declarer/Level + 只抬不压折算)+ IoT 首个生产者 + 她自己的结论走结构化标记穿透安静时段
2026-10-05 13:11:04 +08:00

31 lines
1.8 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package iot
import "git.yeij.top/AskaEth/Cyrene_v2/internal/urgency"
// AlertSeverity 是 IoT 事件的显式严重度。它是**通用紧急度词汇**
// (internal/urgency)在 IoT 侧的别名 —— IoT 是那条通用通道的**第一个生产者**,
// 而不是拥有一条专用通道:任何别的事件生产者(外围插件、系统 / 能力模块)用同一个
// urgency.Level 声明紧急度,backthink 也一视同仁(design/12 §2 §6 安全域豁免,
// 裁决 1.8 / 07.4.2)。
//
// 零值是 SeverityRoutine,因此既有的设备状态跃迁(开灯、调温、窗帘移动)一律落在
// 例行档:本机制不会让常规设备变化获得穿透安静时段的资格
// (design/12 §6 安全域豁免的反面保证)。
//
// 它只回答「这次跃迁有多严重」,不表达身份、权限或能力边界 —— 身份与权限永远由
// channel 层的 actor 元数据与策略引擎决定。
type AlertSeverity = urgency.Level
// IoT 侧沿用的严重度档位名(与 urgency.Level* 逐一同义),让设备来源与既有调用方
// 继续按设备语义阅读。折算到思考轮重要度的口径见 backthink 的 importanceForUrgency。
const (
// SeverityRoutine 是例行设备变化:折算为 ImportanceNormal,安静时段照常扣下。
SeverityRoutine = urgency.LevelRoutine
// SeverityWarning 是值得注意但非安全域的异常(设备离线、耗材将尽):折算为
// ImportanceHigh,沿袭既有语义通过安静时段,但不穿透工作 / 忙碌。
SeverityWarning = urgency.LevelWarning
// SeverityCritical 是安全域事件(入侵、门锁异常开启、烟雾 / 漏水告警):折算为
// ImportanceCritical,穿透安静时段与工作 / 忙碌。
SeverityCritical = urgency.LevelCritical
)