Skip to content

feat(debugger): session-core skeleton — gate, breakpoint table, DebugEvent catalogue, session state machine (WP-2 first half) - #1576

Merged
caomengxuan666 merged 4 commits into
masterfrom
feat150/slice-session-core
Oct 25, 2026
Merged

caomengxuan666 merged 4 commits into
masterfrom
feat150/slice-session-core

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

1.5.0 计划 WP-2 前半:src/debugger/ session-core 骨架

Refs #595
Refs #497

(两条均为 1.5.0 实施目标,保持 open;本 PR 不关单。)

PLAN 行 3(WP-2 session core)的前半落地:调试器 session 核心的纯数据层骨架。零 executor 接触——未接 consult、未改任何 seam、未动既有文件;模块以 pub(crate) 声明(沿仓内 fd 先例),拆分期不扩公共面,待行 4 整体搬家时再放宽为 core 的公共面。

内容(6 文件,+1925/−0)

  • src/lib.rs:+1 行 pub(crate) mod debugger;
  • src/debugger/mod.rs:模块文档与再导出;钉住三条无依赖纪律(无终端、无平台设施、不反向依赖 executor 内部)
  • src/debugger/gate.rs:门控旗 GateFlag / SESSION_ACTIVE(定版 §4.4;WP-1 缺口 G-02 的定义方——在 trap 动作 consult 之前被查,关时成本 = 一次原子加载)
  • src/debugger/breakpoints.rs:断点表数据模型(定版 §5):四种 kind(行 / 函数 / watch / watche;条件为正交字段非第五种)、核验语义(Verified / Unverified 带理由 / Pending)、命中账序(ignore 先于条件、one-shot 在条件真提交时才消费)、watch 的 stop-and-diff(双 epoch 优先于渲染比对)
  • src/debugger/event.rs:类型化事件流,按 WP-1 事件目录 DE-01…DE-12 逐项建模;Stopped 一变体承载 DE-02/DE-03、靠 seam 区分;FrameReturn 的四条返回路线(含入口被 skip、入口 force-return 两条旁路)为一等公民
  • src/debugger/session.rs:session 状态机(入口停点为初始态,定版 §14 Q1 裁定 (a))、事件队列、异步停旗(信号侧只置旗、边界轮询消费且只消费一次)

纪律自查(簇侧 + 集成侧双验)

  • src/debugger/ 的 use 只有 std 与模块内 super:: 互引;禁表面(std::io / std::process / libc / 平台与终端设施)零命中
  • 外部项目命名扫描(新增文件 + 全部 commit 信息):零命中;命名与注释均从 rubash 自身结构与 niu 消费实践推导
  • 随模块同行 39 个单元测试

WP-3 接线注记

见簇报告 §5,要点:漏斗早退是第一约束(trap_exec.rs:978-985 无动作路径上 consult 同样要被询问,G-03);P-1(入口 skip 时 RETURN trap 抑制)先以行为钉定谳再落 DE-04(G-04);DE-09 挂驱动/分发收尾侧而非只挂 trap 漏斗(G-13);门控的 activate/deactivate 配对归驱动层,状态迁移刻意不碰全局旗。

验证结果在本 PR 评论区补账(集成树、净化环境、门控构建)。

WP-2 first slice: src/debugger/ enters the tree as a crate-internal
module (the split freezes the public candidate surface; the module
widens when it moves to its core home). The gate flag is the design
section 4.4 session AtomicBool whose definition WP-1 gap G-02 was
waiting for: one atomic load is the whole debugger-off cost.
Design section 5 in one table: line, function, and the two watch
kinds share the fixed entry field set (id, kind, target, enabled,
ignore count, hit count, optional condition, optional command list,
one-shot). Conditions are an orthogonal field, not a fifth kind;
function entries start pending; watch entries carry their
previous-stop snapshot for stop-and-diff. Hit accounting lives in
the table: disabled counts nothing, ignore credit is spent before
conditions are consulted, and a one-shot entry is deleted at its
committed stop — a false condition verdict commits nothing.
The WP-1 catalogue DE-01..=DE-12 as the session-owned typed event
stream, with the seam kind tags of the catalogue section 4 driving
stepping filters and fixture attribution (not admission tiers).
Stop payloads carry the stop point command text from the same
frozen source the trap path reports (WP-1 pin P-3); frame returns
are their own event including the entry-skipped and entry
force-returned bypass routes. Job completion and pipeline status
stay rendered inspection data, not events.
Stopped(entry) / Running / Terminated with the design section 6
arming recorded as data (Continue / StepInto / StepOver / Finish;
the predicates that evaluate an arming against a live seam are the
stepping work package). Transitions queue their own events, the
entry stop is the second half of DE-01, and the asynchronous stop
flag of gap G-07 is set-only from the signal side and consumed
exactly once at the boundary poll. State transitions are pure:
gate activation is an explicit driver step, so the machine is
testable without touching process state.
@caomengxuan666

Copy link
Copy Markdown
Member Author

集成验证账(集成树 d46869d0a,基线 master e8b65463,净化环境剥除全部 JARVIS_*,门控构建)

  • cherry-pick:簇 4 提交(d787d5c8/0ca13a69/cc49eadc/987a991e)→ b18299c/3feafd4f5/815249c83/d46869d0a,零冲突;改动面恰 6 文件 +1925/−0,与簇报告逐项吻合;作者署名 曹梦轩 已核;推送后 gh api 核实远端 sha = 本地 HEAD。
  • build --locked rc=0(4 条 unused-import 警告:mod.rs 再导出在骨架阶段尚无消费者,WP-3 接线后自然消除)。
  • debugger 单元测试 39/39。
  • lib 全量(--skip login_posix_env 协议):771 过 / 1 败 / 1 ignored;771 = master 基线 732 + 本簇 39;唯一败 = ownership_unary_operators_check_existing_file(许可的 root 环境基线项,与当前 master 基线逐项一致)。
  • 246 差分:首跑 241/5(高负载下 flake 混入),复跑 243 过、失败 {gl08, ps06, ms10};ps06(wait -n 计时形)隔离 5 跑 3 过 2 败双向翻转,与既往各片定谳一致(GNU 本体同竞态)→ 稳定集 {gl08, ms10} 达标。骨架不接线、行为零漂移与此相符。
  • fmt:5 个新文件 per-file rustfmt 全干净;src/lib.rs 报 DIFF,经 pristine master 同文件对照确认为存量漂移(rustfmt 的 hunk 无一落在本片 +1 行 pub(crate) mod debugger; 上),未动。
  • 改动 6 文件 CR 全 0;外部项目命名扫描(新增文件 + 全部 commit 信息)零命中。
  • continuation.rs 未触碰;无 executor 改动。

集成报告:~/workspace/rubash-150/integration/SLICE-150C-REPORT.md。合并归主会话把关。

@caomengxuan666
caomengxuan666 merged commit ec279df into master Oct 25, 2026
7 of 10 checks passed
@caomengxuan666
caomengxuan666 deleted the feat150/slice-session-core branch October 30, 2026 01:41
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.

1 participant