Skip to content

fix(#107): settle-guard activity 收敛到 bus + 漂移门覆盖 §18.11 + CHANGELOG 历史措辞 - #108

Merged
zzjcool merged 3 commits into
mainfrom
fix/guard-gaps
Nov 19, 2026
Merged

zzjcool merged 3 commits into
mainfrom
fix/guard-gaps

Conversation

@zzjcool

@zzjcool zzjcool commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Fixes #107(条目来源:PR #105 报告 docs/reports/contract-cleanup.md §2 的 3 处实现/文档不一致 + 1 处守卫盲区)

交付报告:docs/reports/pi-async-guard-gaps.md(逐项判据、file:line 证据、变异记录)。

四处改动

  1. settle-guard 私有 activity 副本删除:src/guard/settle-guard.ts 不再自带 reportActivity(),agent_before_settle / register() 都走 src/core/bus.ts(一处实现、一个文案)。bus.ts 的 reportActivity 补 try/catch,宿主拒写(stale ctx)时吞异常并返回 false;守卫先答完当前 settle 边界再 dispose() 死代——异常不参与、也不改变 settled 判定(0.3.2 自愈保留)。
    • 文案选 bus 的 N async tasks(恒复数):bus 是 3 个调用点共享的实现,选它只改守卫 count==1 一条路径;选守卫单数则要改共享 formatter、波及 TUI/扩展三处。1 async tasks 的语法瑕疵记录为已知 cosmetic。
  2. 漂移门扩到 §18(含 §18.11)+ 下限:tests/f-reminder.test.ts 的守卫改为 scanToolSurfaceContract(),扫 §17 + §18,断言 sections === ["§17","§18"] 且 checks >= 5;自测覆盖 §18.11 时 6 个 → 时 5 个、§17 默认 5 个工具 → 6 个工具,以及「丢段 → 下限失败」。旧门对同一漂移文本 13/13 通过(盲区复现),新门红。
  3. CHANGELOG 历史措辞:0.2.0 的 per-task activity id 从「OSC 7501 / legion viz 侧可见」降级为「id 形状约束,不是可见性承诺」——仓库无 OSC 生产者、写入只走 feature-detect 的 ui.setActivity、legion 侧依赖上游 #156。
  4. CONTRACT §7 同步:原文的「四处特性检测 / 已知实现分叉」改为「三处 shim + 守卫走同一实现」,避免本次改动留下新的文档不一致。

验证

  • npm run typecheck — pass
  • npm test — baseline 474 / 445 pass / 16 fail / 13 skip → after 480 / 451 pass / 16 fail / 13 skip;失败集合逐条相同(本机 macOS 既存失败,CI 是 Ubuntu),新增 6 条测试,无删除/新增 skip。
  • 变异:恢复私有副本 → a-settle-guard 3 fail(文案/结构/抛错三条);§18.11 单点漂移 → 旧门通过、新门 1 fail。

….11 in the drift gate

- settle-guard: delete the private reportActivity copy. before_settle/register now call
  src/core/bus.ts; reportActivity swallows a stale-ctx rejection and returns false, so the
  settle decision never depends on activity while the guard still disposes the dead generation
  after answering (0.3.2 fix preserved). Wording unified to bus's literal `N async tasks`.
- drift gate: scan §17 + §18 (incl. §18.11) with lower bounds (sections + checks) and self-tests
  for `时 6 个` → `时 5 个` and `默认 5 个工具` → `默认 6 个工具`; a truncated contract fails too.
- CHANGELOG: per-task activity id is a shape constraint, not a visibility promise.
- CONTRACT §7: record the convergence (was "known implementation fork") and current bus cites.
- report: docs/reports/pi-async-guard-gaps.md (Fixes #107).

Verification: typecheck pass; tests 480 / pass 451 / fail 16 / skipped 13 — the 16 failures and
13 skips are the identical pre-existing macOS set from the 474-test baseline (no regression).
@zzjcool
zzjcool merged commit 46d046e into main Nov 19, 2026
5 checks passed
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.

guard gaps: settle-guard 私有 activity 副本 / 漂移门漏扫 §18.11 / CHANGELOG 历史可见性断言

1 participant