Skip to content

docs(catalog): add IP-031 for the manager-context versus Turn-authority boundary - #4432

Merged
huangruiteng merged 1 commit into
loopx-project:mainfrom
Exusty:codex/4373-ip031-manager-context-turn-authority
Sep 15, 2026
Merged

huangruiteng merged 1 commit into
loopx-project:mainfrom
Exusty:codex/4373-ip031-manager-context-turn-authority

Conversation

@Exusty

@Exusty Exusty commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add IP-031 Manager Context Versus Turn Authority to the State And Boundary
    family. The Lark Manager connection shipped a boundary the catalog did not
    describe: message visibility is not Turn authority.
  • The pattern documents context-only retention, the three authorized Turn
    sources (provider-native mention, provider-verified reply, or another existing
    typed authority record), the eight-item / 4,000-character projection budget,
    history catch-up that always stays context_only, and settlement of consumed
    materials after a verified reply.
  • Add the matching State And Boundary catalog row and register IP-031 in the
    pattern-to-canary matrix.

Issue Or Task

Validation

Public-safe summaries only, including in HTML comments. Do not paste raw logs,
private data or prompts, private screenshots, credentials, internal URLs, connection
strings, or local paths.

  • Tested revision: 250095447e6134dc288d5005a04704d2daeb1b86
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
static passed loopx check --scan-path docs/concepts/interaction-pattern-catalog.mdok: True, errors=0 (two pre-existing warnings about an absent local .loopx/registry.json)
static passed python examples/interaction-pattern-catalog-smoke.pyinteraction-pattern-catalog-smoke: ok
static passed python examples/canary/catalog-planner-smoke.pycatalog-canary-planner-smoke ok
  • Coverage and gaps: documentation-only change, so runtime and backend checks are
    not_applicable. The three static checks above are the exact validators the
    task named plus the two existing catalog smokes. Untested paths: none
    identified. The Mermaid diagram was authored against the syntax already used by
    IP-026 and IP-028 in the same file but is not rendered by CI.

Frontend / Visual Evidence

  • UI impact: none

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Core control-plane hardening

  • Long-horizon benchmark evidence

  • Operator surface and IM integration

  • Shared Goal Authority and cross-host coordination

  • Architecture and research incubator

  • Target base branch: main

  • Direction tracker or promotion unit: N/A

Shared-authority RFC fixture impact

N/A

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

The Lark Manager connection shipped a boundary where message visibility is
not Turn authority, and IP-031 is the catalog entry for it.

This revision keeps a single IP-031 registration and adds the state-contract
detail to that entry instead of registering the same boundary a second time:
the route-mode trigger, the MANAGER_CONTEXT_ITEM_LIMIT /
MANAGER_CONTEXT_CHARACTER_LIMIT projection budget with context-only item
rendering, the historical_context_only catch-up rule, the note that the
limits bound one Turn projection rather than durable retention, the IP-011
complement, and the unauthorized-mutation bad smell. The P1 importance row
and the registered entry title stay unchanged.

Closes loopx-project#4373

Signed-off-by: Exusty <107248786+Exusty@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
@huangruiteng
huangruiteng force-pushed the codex/4373-ip031-manager-context-turn-authority branch from 2500954 to 874f2c0 Compare September 15, 2026 08:44

@huangruiteng huangruiteng 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.

队列前言(loopx pr-review --state open --limit 200complete=truepolicy_revision=3other-developers-first:本卡是 #4432 在 head 874f2c02c 上的评审。该 PR 与 #4374 登记的是同一个边界,两者需要合成一条目录条目,本 head 就是维护者侧的合成结果。

结论先行:通过。 内容本身正确且比原稿更精确(把运行时常量与 route mode 写进了条目);需要披露的是本 head 不再新增第二个 IP-031——冲突解决把它并入了已落地的同一条目。

动机

Lark Manager 连接上线的边界是「消息可见 ≠ 授权一次 Turn」,interaction pattern catalog 里对应的条目此前只有文字描述:既没写 context_only / turn_authorized 两种 route mode,也没写约束单次投影的限额常量,更没写历史补采的 historical_context_only 标记。结果是读者要判断某个改动是否越界时,只能回去读 Lark 扩展模块,而这正是目录应当省掉的功夫。这段 state contract 填的正是这个空档。

改动思路

入口是 docs/concepts/interaction-pattern-catalog.md 的 IP-031 小节。原稿打算新登记一个条目(含 P0 行、state contract、示范流程),但同一编号的 IP-031 已由并发 PR 先行落地,因此本轮把它改成对同一条目的增补:触发条件补 route mode、预期行为改成引用运行时限额常量、新增 State contract 代码块、补 IP-011 互补说明、把 bad smell 扩到「未授权却真的花了 Turn 并改了 Goal/Todo」。

一个需要明确披露的取舍:原稿的 P0 行没有保留。目录自己的定义里 P0 是「可能阻塞或误路由 controller turn 的热路径」,而该家族里同类边界登记(IP-011 来源契约、IP-028 Connector Runtime Boundary、IP-025 diagnostic sidecar)都是 P1 的持久运行行为,IP-031 已按此落地,因此我保留 P1 与已注册标题,不重复登记、不制造两个优先级。

具体改动

1 个文件 +44/−12,全部落在 IP-031 小节内:触发条件新增 context_only rather than turn_authorized 一条;预期行为改写为 MANAGER_CONTEXT_ITEM_LIMIT(八条)与 MANAGER_CONTEXT_CHARACTER_LIMIT(4,000 字符)、- [context-only] ... 渲染、以及「限额只约束一次 Turn 投影,不等于持久 retention」;补上 historical_context_only=True;新增 State contract 代码块(manager_route_authoritymanager_context_materialconnection_health);bad smell 增补未授权 mutation 一句。

我逐项核对了 contract 里的名字确实存在于运行时:lark_manager_context_retention_v0MANAGER_CONTEXT_ITEM_LIMIT = 8MANAGER_CONTEXT_CHARACTER_LIMIT = 4000historical_context_onlyloopx/extensions/lark/manager_context.pycontext_only / turn_authorizedmanager_routing.pycontext_only_captured / replied_and_acknowledgedgoal_topic_runtime.pyexamples/interaction-pattern-catalog-smoke.py 在本 head 输出 okgit diff --check 干净。

对主干的风险

文档型改动,主要风险是「契约与运行时漂移」:contract 块是运行时名字的手工副本,目录 smoke 只校验接线结构,不校验这些名字是否仍然存在,将来重命名会静默过时。这条已作为 P3 记录,并给出可执行的收口方式(用一个 docs smoke 断言 schema version、mode 枚举与限额常量)。

第二类风险是重复登记,也就是本 PR 原本的形态:同一模式出现两个 IP-031、两个优先级分类,且两段正文各自演化。本 head 已通过 rebase 消除——IP-031 在目录里仍然只出现三处(家族行、P1 行、小节),P0 行不再出现。此外该 PR 的 fork workflow 首次运行时处于 action_required,由维护者放行后才执行,Sign-offmerge-gatedependency-reviewchanges 与 docs 路径矩阵均通过,其余 job 按路径条件 skip。

我的整体评价

这是对既有条目的实质增补而非重复:它把「可见性≠授权」从一句判断补成可对照运行时的契约,且每个新增名字都能在代码里找到对应物。与 #4374 的条目争号问题已通过「一条目、一优先级、一标题」的合成解决,作者提交的作者信息保留,维护者签名一并附上。P3 观察已记录,不阻塞,本 head 给通过结论。

English verdict: APPROVE at exact head 874f2c0 — the revision folds the manager-context state contract into the single registered IP-031 entry instead of registering the same boundary twice, adding the context_only versus turn_authorized trigger, the MANAGER_CONTEXT_ITEM_LIMIT / MANAGER_CONTEXT_CHARACTER_LIMIT projection budget with context-only item rendering, historical_context_only=True, the IP-011 complement, a State contract block, and the unauthorized-mutation bad smell. Every cited name resolves in the Lark extension modules, IP-031 still appears as exactly one registration (family row, P1 row, section), examples/interaction-pattern-catalog-smoke.py passes at this head, and git diff --check is clean. One non-blocking P3 finding: the contract block is a hand-maintained copy of runtime names that no smoke asserts, so a future rename would drift silently.

@huangruiteng
huangruiteng merged commit c74c3e6 into loopx-project:main Sep 15, 2026
18 checks passed
@huangruiteng

Copy link
Copy Markdown
Collaborator

合并决策记录(exact head 874f2c02c

决策:合并。 合并提交 c74c3e60cMerge pull request #4432 from Exusty/codex/4373-ip031-manager-context-turn-authority),第二父提交即本次评审并验证的 head 874f2c02ca069016d824f26f05517d74fa626bda

变更面docs/concepts/interaction-pattern-catalog.md,+44/−12,全部落在 IP-031 小节内:route mode 触发条件、MANAGER_CONTEXT_ITEM_LIMIT / MANAGER_CONTEXT_CHARACTER_LIMIT- [context-only] ... 渲染、historical_context_only=True、「限额只约束一次 Turn 投影」、IP-011 互补说明、State contract 代码块、以及扩写的 bad smell。

跨 PR 集成决定(需要披露):本 PR 与 #4374 登记的是同一边界、同一编号 IP-031。#4374 先落地,因此本次没有保留第二个 IP-031 登记:原稿新增的 P0 行与第二个小节已移除,改动改为对已注册条目的增补。保留 P1 分类与已注册标题的理由是目录自身的定义(P0 为可能阻塞/误路由 controller turn 的热路径,P1 为持久运行行为),且该家族内同类边界登记(IP-011、IP-025、IP-028)都是 P1。作者提交的作者信息保留,维护者签名一并附上。

已跑检查

  • python examples/interaction-pattern-catalog-smoke.py 在 exact head 输出 ok
  • IP-031 在目录中仍恰好三处登记(家族行、P1 行、小节),git diff --check 干净,改动未越出 IP-031 小节。
  • state contract 的每个名字都在代码中可解析:lark_manager_context_retention_v0MANAGER_CONTEXT_ITEM_LIMIT = 8MANAGER_CONTEXT_CHARACTER_LIMIT = 4000historical_context_onlyloopx/extensions/lark/manager_context.py)、context_only / turn_authorizedmanager_routing.py)、context_only_captured / replied_and_acknowledgedgoal_topic_runtime.py)。
  • PR 上 Sign-offmerge-gatebuildchangesdependency-review 与 docs 路径矩阵通过;其余 job 按路径条件 skip。

失败、跳过与人工保留

  • fork PR 的 workflow 首次处于 action_required,由维护者放行后才执行,属于仓库对 fork 提交的常规审批,不是失败。
  • 未本地验证:无(纯文档改动)。
  • 非阻塞观察(P3):state contract 是运行时名字的手工副本,目录 smoke 只校验接线结构,不校验这些名字是否仍存在;将来重命名会静默过时,收口方式是用一个 docs smoke 断言 schema version、mode 枚举与限额常量。

门禁说明:与 #4374 相同,require_last_push_approval 在该 PR 上无法由推送者自己满足。合并前已取得 exact head 的有效 APPROVE 结论,并按仓库所有者的显式授权使用规则集 owner bypass;bypass 只用于这一条推送审批要求。

English summary: merged at exact head 874f2c02c (merge commit c74c3e60c) after an exact-head APPROVE and green required checks. Because #4374 had already registered the same boundary as IP-031, this revision lands as an enrichment of that single entry: the duplicate P0 row and second section are gone, the P1 row and registered title stay, and the added state contract, constants, route-mode trigger, IP-011 complement, and bad smell are folded into the one section. Validation: catalog smoke ok, clean diff check, exactly three IP-031 registrations, and every contract name resolving in the Lark extension modules. One P3 finding records that the contract block is a hand-maintained copy of runtime names that no smoke asserts. The owner ruleset bypass was used only for require_last_push_approval.

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.

[Task]: Add IP-031 for the manager-context versus Turn-authority boundary

2 participants