Skip to content

feat(resume): retain principal on tracked resume#93

Draft
zane668 wants to merge 9 commits into
aannoo:mainfrom
zane668:upstream/principal-p2
Draft

feat(resume): retain principal on tracked resume#93
zane668 wants to merge 9 commits into
aannoo:mainfrom
zane668:upstream/principal-p2

Conversation

@zane668

@zane668 zane668 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Implements the tracked-resume portion of #87.

Depends on #92. Until #92 lands, this stacked draft intentionally includes the durable principal foundation commits; after #92 merges it will be rebased so only the tracked-resume delta remains.

Scope:

  • retain the same principal only for tracked hcom resume
  • keep fork, adoption, vanilla resume, and explicit name reclaim fresh
  • require lifecycle-consistent stopped evidence for row-gone recovery
  • reject missing, split, tied, or raced identity evidence instead of guessing
  • bind resume reservations to the launching process so stale cleanup cannot claim or delete a later lifecycle

Validation:

  • 1999 unit tests and 22 CLI tests pass
  • focused resume and deterministic interleaving regressions pass
  • fmt, clippy with warnings denied, and diff checks pass
  • the old v18 binary can read the new stopped-event payload and preserves durable bindings

Closes #87

Codex added 9 commits July 15, 2026 06:38
Session: manual
Producer: human
Session: 019f6534-6e28-7961-83d8-395d5a971897
Producer: ai-session
Tool: codex
Session: 019f6534-6e28-7961-83d8-395d5a971897
Producer: ai-session
Tool: codex
Session: 019f65af-bd6c-7492-8b8b-34e17c1822c0
Producer: ai-session
Tool: codex
Session: 019f65af-bd6c-7492-8b8b-34e17c1822c0
Producer: ai-session
Tool: codex
Session: 019f65af-bd6c-7492-8b8b-34e17c1822c0
Producer: ai-session
Tool: codex
Session: 019f65af-bd6c-7492-8b8b-34e17c1822c0
Producer: ai-session
Tool: codex
Session: 019f65af-bd6c-7492-8b8b-34e17c1822c0
Producer: ai-session
Tool: codex
承接 RFC-P2 issue aannoo#87:只有按已登记名字执行的 tracked resume 会复用当前一致主体,或实例行消失后唯一最新且属于最近停止生命周期的持久绑定。adoption、fork、显式重名回收和普通启动继续生成新主体。

启动前以事务复核主体并占住名字;以本次 process_id 写入轻量 reservation token,认领时在同一事务内复核 name、principal、token 与持久绑定后才写 process binding,失败清理也只删除本次 token 所有的占位。旧启动因此不能认领或误删同主体的后续重试,也不能删除并发回收的新生命周期。

新停止快照记录 principal 并在恢复时精确匹配;旧快照没有 principal 时,只接受创建时间落在该生命周期起止区间内的绑定。缺失、裂态、最新时间并列、崩溃回收或竞态均明确失败,不猜历史主体。连续 resume 主体恒定且进程绑定重铸;启动失败保留原持久绑定。

验证:cargo test --locked 通过 1999 个单元测试和 22 个 CLI 测试,0 failed;原有实工具、PTY 与 relay 用例仍按标记 ignored。cargo clippy --all-targets --all-features --locked -- -D warnings、cargo fmt --all -- --check 与 git diff --check 均通过。

Session: 019f65e0-ae1d-7a02-9bc0-4be3dfea1ae0
Producer: ai-session
Tool: codex
@zane668

zane668 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

CI triage: the three failing jobs are the same upstream-main baseline failures isolated in #91, not P2 regressions. Both rust-tests and windows-build stop on the pre-existing redundant &entry.timestamp clippy error; release plan stops because the generated cargo-dist workflow is stale. All six real-tool jobs and typecheck passed on this stacked draft. After #91 and #92 land, this branch will be rebased and rerun as the single P2 delta.

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.

RFC: tracked hcom resume retains principal

1 participant