Repository navigation
diagnose(shell): 记录选区被丢弃的分支原因 (#156) - #186
Merged
Merged
Conversation
TextSelection gains an opt-in discard observer with named branches (epoch, anchor, identity, text, endpoint); the shell installs a JSONL writer only when TERMFORGE_SELECTION_DIAG is set. Selection contracts add a group proving the observer receives the epoch branch; behaviour is unchanged without the variable.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…facts refs #156 The python runner sets TERMFORGE_SELECTION_DIAG inside each scenario output directory so a hosted discard reason lands in build/test-artifacts and survives as failure evidence.
JavaZeroo
force-pushed
the
diag/selection-discard-reason
branch
2 times, most recently
from
October 29, 2026 14:26
3d20895 to
261ea8d
Compare
Trailing newline restored after the diagnostic edit; no behaviour change.
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
内容
为 #156 加只诊断、不改行为的选区丢弃原因观测:
TextSelection增加可选丢弃观察器set_discard_observer,内部把每次invalidate()的分支命名:epoch-mismatch、anchor-missing-or-shrunk、row-identity-replaced、row-text-changed、endpoint-unavailable;TERMFORGE_SELECTION_DIAG=<jsonl 路径>时安装观察器,向该文件追加{"schema":"termforge-selection-discard-v1","reason":"..."};未设置时不写文件、无任何行为变化;selection_core新增一组契约:安装观察器后触发 epoch 失效,断言收到epoch-mismatch;experiments/shell/README.md增加使用说明与分支含义。验证
selection_test、termforge_shell通过;selection_test输出selection contracts passed (8 independent groups),exit 0。动机
hosted 上偶发
actions geometry lost terminal selection(Find 命中在、选区丢)。上一轮已把机制定位到TextSelection::reconcile+shell.cpp的 publish 时机;本 PR 让失败时能直接看到是哪一类不一致(epoch / 锚点 / 身份 / 文本 / 端点),为判定"中间态竞态"还是"确定性裁剪"提供证据。
Refs #156