Wash the uplink
A type-1 rule dedupes and snapshots a stream so the main brain sees what is new this tick — for example a fresh heard_text. It does not emit steps.
神赐
Authorized local rules · v0.9
Speech already reaches the brain slot. The round trip is too slow, and the uplink is too fat. 神赐 is a grant the main brain issues so this body can wash a stream or emit menu steps locally — without rewriting Body OS.
This page is the public spec. It is not a second organ protocol, not a second ISA, and not a start-code order. Frame stays 0xAA … 0x55. Action names stay menu ASCII. Empty steps still mean silence.
Read Body OS first — the organ bus lives there · Leo · WhatsApp +86 17052886709
A cloud consult takes seconds. IMU and speech should not wait on that every tick. The kernel stays a post office.
A type-1 rule dedupes and snapshots a stream so the main brain sees what is new this tick — for example a fresh heard_text. It does not emit steps.
A type-2 rule may emit menu steps only inside the grant: named fields, named actions, min / max. Out of bounds it hands off. It does not invent names.
One rule slot, not two instances fighting over the same IMU. CAN_WATCH, CAN_ACT, or both. The main brain sets the bits. Change bits = a new grant.
| Layer | Who | Does | Must not |
|---|---|---|---|
| 1 Driver | Human | Slow intent: walk forward, what can you do | Care how a step reaches a motor |
| 2 Main brain | Brain-slot controller | Read the contract and the wash; emit steps / memory; issue and revoke grants | Touch UART; invent unlisted names; run a millisecond loop |
| 3 Local rule | 神赐 — authorized assistant | Fast loop: wash a stream, or emit params inside the grant | Wire organs privately; self-declare jurisdiction; become a second controller |
| 4 Kernel | Bus | Register organs; copy named fields; forward by the main-brain table; send steps | Parse Chinese; understand “balance”; write motors from events |
| 5 Organ | Hardware | Execute ASCII names; clamp min / max; optional on-organ loop | Parse user speech; invent abilities |
Main brain is slow. Rules are fast. Don’t-fall and current clamp stay on the organ closed loop — not in the rule, and not in the kernel.
To change subscribe, priority, or revoke: the main brain issues a new table. A rule cannot tell the kernel to give it the chassis. Quota is the main brain’s; today it can be zero.
The brain-slot language is already JSON. A blessing is one more envelope into a rule slot. It does not ride the organ UART.
| Layer | Sees |
|---|---|
| Main brain → rule slot | JSON. Swap an IMU by changing field names, not by rebuilding firmware |
| RAM | A C cache of that JSON. Implementation, not the contract |
| Kernel | Slot id, field names to copy, priority number, whether this slot may emit steps. It does not read the word “balance” |
| Organ UART | The table never appears. Frame stays 0xAA … 0x55 |
rule must be a registered kind. actions[].name must already be on the live menu.
{
"blessing_id": "bal_1",
"rule": "balance_v1",
"priority": 80,
"perm": ["watch", "act"],
"fields": [{"mod": "IMU_001", "n": "pitch"}],
"actions": [{"name": "wheel_left", "min": -1, "max": 1}],
"bounds": {"pitch_abs_max": 35}
}
| Mask | Watch | Act |
|---|---|---|
| watch only | Dedupe, snapshot, uplink wash | Must not emit steps |
| act only | May read granted fields (not a wash for the main brain) | Emit steps inside bounds |
| both | Same tick: wash may go up, compensation may emit steps | Out of bounds → handoff |
Today one busy flag holds the whole consult. USB, heard_text, and self-glance wait. That is a single-thread consult, not a rule scheduler. Split three kinds of busy:
| Busy | Who | When a higher grant arrives |
|---|---|---|
| Rule compute | Rule micro-scheduler | Drop this tick of the lower rule. No suspend stack on C6 |
| Cloud consult | Brain-slot HTTPS | Do not pause TLS. If the same consult stimulus was already taken locally, drop the returned steps by heard_req / req_id. An IMU tick_id must not kill a speech reply |
| Organ executing | Kernel UART forward | Do not cut a frame. New steps wait behind the current step, including needs_completion_ack |
Balance interrupting speech: speech is the organ pipe. Default is let the speaker finish; motor compensation uses other granted names. To stop playback, the rule may only emit a halt-class name already on the menu and on the grant. The kernel does not invent stop_speak. ISA still: priority / depends_on do not reorder organ forward.
| Kind | budget_ms | Typical |
|---|---|---|
| Balance / other closed-loop act | ≤ 10 | PID, attitude compensation |
| Uplink wash (watch-heavy) | ≤ 50 | Dedupe, snapshot |
| Unspecified | 10 if CAN_ACT else 50 | Default |
Timeout skips the tick: no half steps, hold the last issued command (do not zero — that is the jerk), freeze the integrator this tick. Organ closed loop still runs. Repeated overruns → handoff_why over, no per-tick log spam.
| Envelope | Means |
|---|---|
| steps: [] and no handoff | This tick has no motion. Already balanced, or nothing to say. Kernel silent |
| handoff: brain + handoff_why code | This tick the rule does not take. Kernel consults the main brain. Not “job done” |
| steps with menu names, no handoff | Execute inside the grant |
| Non-empty steps and handoff together | Forbidden. Drop the packet |
Do not put need_brain as a steps[].action. Do not add a UART msg_type. handoff is an additive envelope key; until the bible takes it, today’s cloud path is unchanged.
Check live registry: module, field name, actions[].name, rule kind. Any miss → do not load. Keep the previous good table. Reply to the main brain in brain-slot JSON, not a new UART type:
{
"blessing_rejected": true,
"blessing_id": "bal_1",
"why": "miss",
"ref": "IMU_001.pitch"
}
| Code | Means |
|---|---|
| oob | Outside the grant bound |
| unk | Unknown intent / this sentence is not taken |
| miss | Granted field or module is not present |
| over | Rule tick overran repeatedly |
| rej | Grant failed the existence check |
中文
神赐
主脑授权的本地规则 · v0.9
说话已经能进大脑槽。来回太慢,上行太肥。神赐是主脑签发给这具身体的授权:本地洗流,或在边界内出菜单 steps——不是重写 Body OS。
这一页是公开规格。不是第二份器官协议,不是第二份 ISA,也不是开工令。帧仍是 0xAA … 0x55。动作名仍是菜单 ASCII。空 steps 仍是沉默。
先读 Body OS — 器官总线在那一页 · Leo · WhatsApp +86 17052886709
一次云咨询要数秒。IMU 和说话不该每拍都等。内核仍是邮局。
类型 1:去重、收快照,标出这一拍真正新的东西(例如刚到的 heard_text),再上传。自己不出 steps。
类型 2:只在授权边界内出菜单 steps:字段名、动作名、min / max。越界就交还。不发明名字。
一个规则槽,不拆成两个实例去抢同一颗 IMU。CAN_WATCH、CAN_ACT,或两者。主脑点位。改位 = 再签一张表。
| 层 | 谁 | 做什么 | 不做什么 |
|---|---|---|---|
| 1 驾驶员 | 人 | 慢意图:向前走、你都会什么 | 不关心步进怎么接到电机 |
| 2 主脑 | 大脑槽里的控制器 | 读合同与摘要;出 steps / memory;签发、收回赐福 | 不碰 UART;不发明未登记动作名;不做毫秒环 |
| 3 本地规则 | 神赐 — 主脑授权的助手 | 高速循环:洗流,或在授权内出执行参数 | 不私接器官;不自报管辖;不当第二主脑 |
| 4 内核 | 总线 | 登记器官;按字段名抄流;按主脑的表转发;下发 steps | 不解析中文;不懂「平衡」;不按事件写电机 |
| 5 器官 | 硬件 | 按 ASCII 名执行;min / max;可选器官闭环 | 不解析用户原话;不发明能力 |
主脑慢,规则快。摔倒、电流钳位留在器官闭环——不进规则层,更不进内核。
改订阅、改优先级、收回:再出一张主脑授权。规则不能对内核说「把底盘也给我」。配额由主脑定,今天可以是 0。
大脑槽的语言已经是 JSON。赐福是主脑写进规则槽的一张表。不下器官 UART。
| 层 | 看到什么 |
|---|---|
| 主脑 → 规则槽 | JSON。换 IMU 只改字段名,不重烧固件 |
| RAM | 解析后的 C 缓存。那是实现,不是合同 |
| 内核 | 槽位号、要抄的字段名、优先级数字、本槽可否出 steps。不读「平衡」二字 |
| 器官 UART | 不出现这张表。帧仍是 0xAA … 0x55 |
rule 必须是固件已登记的种类。actions[].name 必须已在当前菜单。
{
"blessing_id": "bal_1",
"rule": "balance_v1",
"priority": 80,
"perm": ["watch", "act"],
"fields": [{"mod": "IMU_001", "n": "pitch"}],
"actions": [{"name": "wheel_left", "min": -1, "max": 1}],
"bounds": {"pitch_abs_max": 35}
}
| 掩码 | 看 | 做 |
|---|---|---|
| 只有 watch | 洗流、去重、上行摘要 | 禁止出 steps |
| 只有 act | 仍可读授权字段(不算给主脑洗包) | 边界内出 steps |
| 两者都有 | 同一拍:摘要可上主脑,补偿可出 steps | 越界走 handoff |
今日一个 busy 占住整次咨询。USB、heard_text、自省都要等。那是咨询单工,不是规则调度。三件忙必须拆开:
| 忙 | 谁 | 高优来了怎么办 |
|---|---|---|
| 规则计算 | 规则微调度 | 丢弃本拍低优计算。C6 不堆挂起栈 |
| 云咨询 | 大脑槽 HTTPS | 不暂停 TLS。同一咨询刺激已被本地收掉 → 按 heard_req / req_id 丢掉回来的 steps。IMU 拍号不作废语音咨询 |
| 器官在执行 | 内核按数组转发 UART | 不中途掐帧。新 steps 排在当前步之后(含 needs_completion_ack) |
平衡打断正在说话:说话是器官管道。默认喇叭说完;电机补偿走已授权的别的菜单名。若必须停播,只能出菜单上已有、授权表里点过名的停止类能力。内核不发明 stop_speak。ISA:priority / depends_on 仍不改变器官转发顺序。
| 种类 | budget_ms | 典型 |
|---|---|---|
| 平衡 / 其它闭环执行 | ≤ 10 | PID、姿态补偿 |
| 数据梳理(watch 为主) | ≤ 50 | 去重、摘要 |
| 未声明 | 有 CAN_ACT 则 10,否则 50 | 缺省 |
超时 = 本拍跳过:不出半截 steps,保持上一拍已发出的命令(不要清零——那才抖),积分本拍冻结。器官闭环仍在跑。连续超时过多 → handoff_why over,不打每拍超时日志。
| 信封 | 意思 |
|---|---|
| steps: [] 且无 handoff | 本拍无动作。已平衡,或无话可说。内核静默 |
| handoff: brain + handoff_why 短码 | 本拍规则不收。内核去咨询主脑。不是「已做完」 |
| steps 里是菜单名,无 handoff | 边界内执行 |
| 同时有非空 steps 和 handoff | 禁止。整包丢弃 |
不把 need_brain 写成 steps[].action。也不发明 UART 新 msg_type。handoff 是信封追加键;未写入圣经之前,现行云咨询路径不变。
按当前登记做存在性校验:模块、字段名、actions[].name、rule 种类。任何一项失败 → 整表不加载。旧的有效表保持。回主脑一封大脑槽 JSON,不是新 UART 类型:
{
"blessing_rejected": true,
"blessing_id": "bal_1",
"why": "miss",
"ref": "IMU_001.pitch"
}
| 码 | 意思 |
|---|---|
| oob | 超出授权边界 |
| unk | 不认识的意图 / 收不了这句 |
| miss | 授权字段或模块当前不在 |
| over | 规则拍连续超时 |
| rej | 赐福校验拒绝 |