Skip to content

docs(rfc): extend steward unified entry across all sessions and Goals - #9329

Open
maxliux5 wants to merge 2 commits into
mainfrom
codex/steward-unified-entry-rfc
Open

maxliux5 wants to merge 2 commits into
mainfrom
codex/steward-unified-entry-rfc

Conversation

@maxliux5

@maxliux5 maxliux5 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Extends the shipped LoopX Steward (chat_manager.py, conversation_binding.ts, StewardPage.tsx, plus shipped #9320 turn_context_cache.py and steward.background.<binding_id>) across all non-Goal Workbench threads and self-opened local sessions alongside LoopX Goals—without creating a second task store, scheduler, or authority.

Delivery Brief

  • Goal / source: Enable a single Steward conversation (App/Workbench + Lark) to view, search, delegate to, safely supervise, and progressively promote every local session alongside LoopX Goals (steward-unified-entry-v0 under capable-manager-semantic-handoff-v0 M1–M3).
  • Current gap on main (49881d5a3): #9320 shipped Core turn_context_cache.py and steward.background.<binding_id> Goal monitor isolation, but Steward still reads/delegates Core Goals only, shares one foreground lock across Lark threads, lacks effect-fenced preemption on non-steerable hosts, lacks supervision safety/cost guardrails (question-only confirmation redline, first-turn anchor reset, exact-quote triage, per-dir write mutex, socket ACL), and cannot promote/escalate stalled sessions into Core Vision/Replan.
  • Observable result (normative design & S1–S4 plan):
    1. S1 — Read-only unified ledger, 2/3-gram + FTS lookup & locate-only @session: Composes Core turn_context_cache.py (#9320) with Workbench threads.ts + local-sessions.ts; pairs SQLite FTS with a rebuildable stat(mtime_ns, size)-verified CJK 2-gram / ASCII 3-gram / cross-script 2-gram exclusion index (.search/); keeps S1 @session strictly locate/open-only (0 unbound session writes/imports).
    2. S2 — Fenced session_handoff, deterministic Lark lanes, effect-fenced preemption & anchor-reset steward.background: Adds session_handoff (spawn + expected_last_turn_id-fenced continue, S2 @session <msg> direct send, per-directory FIFO write mutex for non-worktree targets, caller-credential 403 socket ACL, dynamic supervisor prompt injection); routes explicit Lark root_id threads to child lanes while keeping top-level P2P messages deterministically in lobby (steward.auto_thread_on_busy=false default); gates steering: False preemption on host-enforced read-only mode or atomic old-Turn effect-admission closure (0 duplicate effects); adds first-turn anchor reset + pruned supervisor tools on steward.background.<binding_id> (< 10% uncached token drift at round 200); enforces L2 Goal Coordinator upward silence (Reached / Needs decision / Stuck > 24h) and L3 Task Leader child-worker cap (≤ 8).
    3. S3 — Rules-first watch, conservative grants, question-only redline, exact-quote triage & concern closure: Conservative initial SupervisionGrant (["continue", "retry", "answer_choice"] default; switch_model/split opt-in behind D2); hard code block preventing steward.background from ever auto-approving permission, plan, screen, secret_run, or external_send prompts (0/N); exact-substring verification on choice triage (failing open to raw tail excerpt); completion-evidence gate; durable concern -> concern_report closure; and 15s merged notifications.
    4. S4 — Progressive Goal promotion & Vision/Replan escalation: Zero-ceremony session -> Goal attachment (open_session=false), escalating ≥ 2 rejections / contradicted yardsticks to Core Vision/Replan with cross-day heartbeat and quota/stride governance.
  • Reconciliation with PR review (PRR_kwDOStEbEs8AAAABZxfInw + inline comments):
    • Rebased onto 49881d5a3; moved #9320 turn_context_cache.py and steward.background.<binding_id> into §4.1 shipped capabilities and decoupled §8/A8 rollbacks so disabling ledger.capture or steward.topic_lanes never disables LOOPX_MANAGER_CONTEXT_CACHE or steward.background Goal monitor isolation.
    • Restricted S1 @session to locate/open-only navigation and moved @session <message> unbound/non-Goal sending into S2 session_handoff.
    • Resolved D3 for S2 v0 (lobby deterministic default for top-level P2P messages; explicit root_id threads run in parallel child lanes).
    • Required atomic old-Turn effect-admission closure + zero-effect readback before soft preemption on steering: False hosts, plus interleaved write-race coverage in A3.
    • Separated expressible SupervisionAction vocabulary from the conservative S3 default grant (["continue", "retry", "answer_choice"]) and added continuation-only negative checks in A4.

Validation

  • uv run --extra test python scripts/generate_rfc_status_index.py --check — passed
  • uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEAD — passed
  • uv run --extra test python examples/docs-governance-smoke.py — passed
  • uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main — passed
  • Boundary: Documentation-only RFC proposal (Delivery maturity: Proposal); no UI surface or runtime behavior changed in this PR.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

  • [P2] 用实际目标主干定义既有后台会话、缓存和回滚。目标主干 80993ef407d7ff847b0b8a58efef598ab143694f 已合入 #9320,具备后台监控会话和按修订号验证的缓存。§4.2 仍把两者视为缺失,S1/S2 将其列为待实现,§8 又把监控路由和新话题开关绑定。按现文执行,关闭未来话题功能时可能退回单会话争锁,丢失主干已有隔离。A8 只关督办,无法区分这条回滚路径。 更新两份基线与 S1/S2 边界,复用 #9320 已有 owner,明确关闭新话题与新账本功能时保留主干的后台监控路由及缓存配置。A8 以实际合入目标为对照,逐项写清开关关闭时的既有行为。 用实际目标主干定义既有后台会话、缓存和回滚
  • [P2] 把向未绑定会话发消息放到 S2 的路由与授权之后。§5.5 与 S1 交付表把 @session 写成直接发送,S1 的三个接口只读。原始会话的白名单目录、导入、当前 Turn 校验及返回路由在 S2 的 session_handoff 才定义。S1 独立发布时,文档无法保证这条发送使用正确绑定,A1/A2 也仅验证发现和查找。 让 S1 的 @session 只定位或打开现有会话,或把向新发现会话发送移入 S2,复用 fenced continue 与当前授权。若 S1 保留已绑定会话的直接发送,明确使用现有入口及适用对象。 把向未绑定会话发消息放到 S2 的路由与授权之后
  • [P2] 在 S2 确定忙碌时飞书顶层消息的默认路由。§5.3 规范明确自动创建消息话题并行回复,§12 D3 把同一选择列为待批准,另一路仍可留在 lobby 排队。两种路径对用户可见的回复位置、排队和后续更正路由不同,A3 当前无法判定哪种符合首版要求。 把待决选择落实为首版默认与后续资格门,或者待 D3 确认后同步两个语言版本的规范、S2 和 A3。说明用户收到的排队或话题回复以及后续更正归哪条车道。 在 S2 确定忙碌时飞书顶层消息的默认路由

动机 / Motivation

同时开着终端会话、Workbench 和 LoopX Goal 的用户,需要在管家里找到进度和当下要处理的事项。 用户在终端开一项调查,同时发消息问两个 Goal 的进度。当前管家只看到 Goal 侧的任务。RFC 让用户先在一处找到这项调查并打开原会话,后续里程碑另行交付受控委派和原路回报。 本提交交付中英文设计与 S1–S4 的验收路径。主干已有的缓存和后台监控归属,以及 S1 的首条跨会话发送范围,需要在实施前对齐。 本提交只改文档。没有运行新会话委派、督办或飞书旅程。

改动思路 / Approach

读路径在 Workbench 组合 Core Goal、工作线程和本机会话索引。Goal 写入仍由 Core 所有。需要发消息或接续会话时,提案复用 Workbench 的线程邮箱,并让结果回原管家话题。S1 先交付已授权的查找与定位,S2 在现有目标路由和会话所有权上补齐发送及回报。

具体改动 / Changes

审阅提交 2689652ba256454131d4e04029428fc77176d036,目标主干为 80993ef407d7ff847b0b8a58efef598ab143694f。两份 RFC 各增加 387 行,导览增加 11 行,生成索引合计 +4/−2。正文定义四个可回滚阶段及十项验收。静态对照中英文的现状、阶段、授权和待决章节。按已有 docs/architecture/rfcs/capable-manager-semantic-handoff-v0.md 在 80993ef407d7ff847b0b8a58efef598ab143694f 上的 A3、A8 核对。A3 的队列授权撤销与 A8 的原受众重启回报能用来审阅提案边界。新会话的支持仍需 S2/S3 分别验证。 现有 A3 与 A8

对主干的风险 / Risks

成对 RFC、生成索引、docs-governance smoke 和标准 premerge 均通过,现有后台监控与缓存的 13 项源码测试通过。 背景测试覆盖交互忙碌时后台监控、重启与旧队列,缓存测试覆盖修订变化及关闭。上述检查验证已经合入的行为与文档治理。新的 @session 发送和飞书话题路由目前只能走读规范。远端 CI 未查询。主干后台监控 · 主干缓存开关

我的整体评价 / Verdict

请更新两份 RFC 的主干基线和开关回滚,明确 S1 只读路径与 S2 发送边界,并为 S2 的 D3 取舍写出首版真实默认和验收。本次五文件是 RFC、索引和导览,未修改任何渲染入口。 让首版验收分别覆盖只读发现、已绑定会话发消息,以及飞书顶层消息和更正的归属。

English verdict: REQUEST_CHANGES at 2689652. Reconcile the RFC with the shipped cache and background monitor, keep S1 independently deliverable, and resolve the default Lark topic route before S2.

- **专属 `steward.background.<binding_id>` 会话:** 所有 `native_loopx` 定时监控跟进轮(`steward_monitor.py`)与 Workbench 会话督办轮统一进入 `steward.background.<binding_id>`,与真人交互车道物理隔离,零抢锁。
4. **同车道排队合并与无副作用阶段软抢占:**
- **排队期自动合并(Turn Coalescing):** 同一 `lane_key` 忙碌期间连续到达的多条用户补充消息,在下一轮认领时原子合并为同一批输入(保留各自时间戳与消息 ID),一次推理读完全部补充。
- **运行期纠偏与软抢占:** 在支持实时转向的宿主(`codex`)上启用私聊 `live_steering`;在 `steering: False` 的宿主(`antigravity`)上检查当前活跃轮次的步骤账本——若仍处于零外部副作用的只读/思考阶段(未发生文件改动、Git 推送或 Core 写操作),安全触发 `interrupt` 合并重开;若已进入外部写操作阶段,则先回执“当前写入收尾后立即按新要求修正”,落定后紧接执行。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 软抢占须在效果入口封住旧 Turn。

步骤账本只能说明检查之前的情况。一个允许写入但目前只做过读取的 Turn 可以在查账本后、收到 interrupt 前提交第一次写入。此时重开含用户纠偏的新 Turn,会让两个轮次都可能执行同一效果。A3 目前只有纯只读和已经写入两种用例,漏掉了这个间隙。

请在两份 RFC 里把可抢占限定为从准入起就由宿主强制只读的轮次,或由现有 owner 先原子关闭旧 Turn 的效果准入,再读回中断与已受理效果的归属。宿主无法证明安全时,沿现有允许的排队分支回执。A3 补一个扫描后、interrupt 前出现首个写入的交错用例,并断言不会重放该效果。父 RFC 的 A18/A23 已要求拒绝旧执行者的迟到效果或等待原轮次收尾。现有约定


**开关与任务范围授权:**
- 设置新增 `ledger.capture`(默认 `true`)、`supervision.enabled`(默认 `false`)与 `steward.topic_lanes`(owner 私聊默认 `true`),仅允许用户在前端设置中修改。
- 用户对管家说“把 X 修好/做完”或点击「督办」时,写入一条 `SupervisionGrant`(记录可信用户轮 `origin`、`scopeRevision`、允许的 `workdirs`、允许动作 `["continue" | "retry" | "switch_model" | "split" | "answer_choice"]`、`modelPolicy`、`revokedAt`)。每次自动动作提交前重新核验开关、未撤销、`scopeRevision` 未变、会话仍绑定且无用户新消息,先落盘意图回执再发送。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 给督办的默认动作范围一个明确的授权规则。

§5.4 从“把 X 修好”或点击督办创建 SupervisionGrant,并列出 switch_model、split、answer_choice,还允许后台对部分失败自动切换模型或拆分。§12 D2 却仍让负责人在这组动作和只允许 continue/retry 的首版之间选择。实现者无法从本文判断普通续接授权应写入哪几个动作。该差异会改变实际发起的任务和模型预算。

请分开描述可表达的动作枚举和本次授权的实际动作集合。把 D2 落为两种候选配置及对应验收,明确未定时的保守首版,并按具体动作、端点及预算在提交时重新核验。A4 加一组只获续接授权的反例,验证切换、拆分和代答保持待决。同步中英文的 §5.4、S3、A4 与 D2。

Reconcile the steward-unified-entry-v0 RFC pair against shipped LoopX Steward
capabilities (App/Workbench and Lark steward, context_handoff delegation,
continuous_monitor watches, and completion_validation) and complete the design
for managing every local session alongside LoopX Goals:
- compose a read-only open-work ledger over Core Goals/Todos (with revision-
  validated hot snapshot caching), Workbench threads, and local-sessions.ts;
- add session_handoff delegation, Steward Topic Lanes, steward.background
  isolation, and same-lane coalescing/safe read-only preemption to prevent
  foreground head-of-line blocking;
- specify deterministic session watch, bounded recovery, completion-evidence
  gates, and 15-second merged decision notifications;
- connect session supervision to progressive Goal promotion, Vision/Replan
  escalation on repeated rejections or contradicted assumptions, cross-day
  heartbeat continuation, and long-horizon outcome-per-budget measurement.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@maxliux5
maxliux5 force-pushed the codex/steward-unified-entry-rfc branch from 2689652 to 8acc144 Compare November 23, 2026 16:32

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

  • [P2] 让来源版本不确定的会话走原文扫描。S1 用 path、mtime_ns、size 判断旧 gram 段仍有效,并在精确匹配前排除会话。等长的两版合成记录实测可以有完全相同的这三个字段。恢复后的原文命中查询词,旧索引没有对应 gram。按规范先排除会漏掉会话,A2 现有的索引删除及 mtime 过期场景无法捕获它。现有 Core 缓存测试已经覆盖同尺寸、同 mtime 的内容重写,新的 Workbench 排除索引要保有同一正确性边界。 只在内容版本可靠时排除候选。无法证实版本或无法从索引表达查询词时,退回原文扫描。两份 RFC 的 §5.2 和 A2 补上文件属性不变但内容变化的对照。 让来源版本不确定的会话走原文扫描
  • [P2] 核验每个可点击选项来自原问题。§5.4 只核验 question_quote 是否出现在末尾原文,未要求校验实际按钮。准确引用“导出 CSV 还是 JSON?”时,卡片仍能凭空增加第三种格式并通过当前校验。A4 只注入错引,无法否证这种错卡。 原生问题使用现有 typed question 和选项标识。自由文本只有在每个展示选项都能对应原文时才渲染按钮,否则展示原文并保留人工回复。两份 RFC 的 A4 都加上原问题正确而选项不实的反例。 核验每个可点击选项来自原问题

动机 / Motivation

同时使用终端、Workbench 和 LoopX Goal 的人,需要从管家找到原会话,并看清何时需要自己决定。 用户早上开终端调查导出故障,之后在飞书向管家找这项工作。目前管家主要回读已登记 Goal,用户得另行定位。S1 应让用户找到并打开原会话。S2 才通过已验证的目标接续,并把结果送回原话题。 本提交规定 S1 至 S4 的交付顺序、回滚和验收。上一轮的缓存、后台监控、只读定位和飞书默认路由问题已处理。会话查找和点选卡仍有具体规范缺口。 本次提交只交付双语设计、导览和状态索引。

改动思路 / Approach

Core 继续持有 Goal、后台监控和修订缓存。Workbench 持有本机会话和线程邮箱。S1 依据受众和来源查找,S2 才通过当前 Turn 和授权校验接续原会话。S1 先复用现有读路径交付可靠定位,再在完整召回可证明时启用候选排除。

§4、§8、A8 以已合入的 #9320 为基线。新账本或新话题单独关闭时,既有缓存和后台监控仍可工作。S1 的 @session 仅定位或打开原会话,S2 才允许受控发送。顶层飞书私聊继续在 lobby 回复,显式 root_id 消息回原话题。旧轮次首次写入的竞争补了效果封锁和排队分支,D2 也区分了可表达动作与默认授权。 回滚与验收 · S1、S2 与 D3

具体改动 / Changes

关键内容讲解

审阅提交 8acc14467f88b5c712e966cd63f4a275993245b6,目标主干 49881d5a3ac25adf8c105b2dbfdb109716cefbcb。双语 RFC 各 +405 行,导览 +13 行,两份生成索引合计 +4/−2。§5.2 的排除条件决定会话能否进入精确匹配。§5.4 的引用校验决定模型分拣结果能否成为可点击选项。S4 保留 Core 的 Vision/Replan 及跨天预算治理。父 RFC A3 规定排队动作在执行前重验授权,A8 规定重启后回报原受众,A18/A23 规定效果栅栏和精确 Turn 操控。相应实现留在 S2/S3,S1 定位阶段先守住 GQ02 的找回已有工作前置条件。 父 RFC 验收 · 既有缓存的对照用例 · 既有 typed question 入口

对主干的风险 / Risks

PASS。双语配对、生成索引、文档治理和本地 premerge 通过,既有缓存及后台监控的 13 项源码测试通过。 FAIL(规范走读)。文件属性对照证明旧索引可能排除新命中。点选卡反例说明精确引用原问题仍不能验证可选答案。实际多会话发送、真实飞书和逐开关运行时等价仍须在后续切片验收。远端 CI 未查询。

我的整体评价 / Verdict

请在设计中补上索引可靠的失效条件与原文回退,并把点选卡的原文校验扩展至实际选项。这五个文件均为文档,管家界面保持当前行为。 S1 的用户体验首先由原会话定位可靠性验证,S3 由真实可选项的回读验证。S4 的长程收益留待独立成果和完整成本的配对对照。

English verdict: REQUEST_CHANGES at 8acc144. Prior routing and rollback findings are addressed. Preserve session search recall under changed content and verify each actionable choice against the original prompt.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants