Skip to content

fix(antigravity): reconcile folded turn authority, footer background tasks, and silent schedule status - #3799

Merged
deepcoldy merged 7 commits into
deepcoldy:masterfrom
big-omega:fix/antigravity-turn-authority-and-runtime-status
Nov 25, 2026
Merged

deepcoldy merged 7 commits into
deepcoldy:masterfrom
big-omega:fix/antigravity-turn-authority-and-runtime-status

Conversation

@big-omega

Copy link
Copy Markdown
Contributor

Summary

Fixes three production issues observed on Antigravity (agy) sessions and downstream status consumers:

1. P0: Reconcile completed folded Antigravity turns at prompt_ready (6fa79c6f)

  • Problem: Antigravity folds type-ahead messages into an active run and settles them together before returning to idle. In normal botmux send mode (no per-turn transcript bridge terminals), botmux send --response-kind final promotes the next queued turn B on the PID marker (advanceAncestorSessionTurn), and markPromptReady() then re-acquires activeTurnAuthority for already-completed B via syncQueuedTurnsFromMarkerDisk() / advanceQueuedTypeAheadTurn(). Later queueAfterActiveTurn: true schedules are then blocked indefinitely while the CLI sits idle at >, and non-empty pendingMessages blocks idle publication.
  • Fix:
    • src/services/antigravity-transcript.ts: add findCompletedAntigravityTurnIds() (fail-closed while transcript is busy; matches <message_location message_id="..."/> strictly before <user_message>, or exact submittedText with a pre-write minByteOffset lower bound so repeated static prompts cannot match earlier finished runs; requires a subsequent non-empty, non-tool PLANNER_RESPONSE DONE).
    • src/worker.ts: add reconcileCompletedAntigravityTurnsAtPromptReady() before decideQueuedReadyTransition() in markPromptReady() for non-durable turns only (dispatchAttempt === undefined), preserving live successors, durable retries of the same turnId, and the queued-ready-transition.ts contract when B is still executing. Also fix sendToPty() logging when activeTurnBlocks(next) defers a write.

2. Antigravity native footer background task count (520e13b7)

  • Problem: In normal send mode Antigravity does not run the transcript bridge, so active background commands and schedule timers shown in its native footer (? for shortcuts ... N task(s) · /tasks / esc to cancel · N task(s)) were not surfaced via screen_update.backgroundTasks → ds.backgroundTaskCount.
  • Fix:
    • src/adapters/cli/antigravity.ts: add parseAntigravityFooterBackgroundTasks() anchored strictly to the viewport-tail footer with separator boundary (handling narrow 2-line wraps, returning undefined when no real footer is visible so previous counts are preserved, and returning 0 once task(s) disappears).
    • src/worker.ts: fold parsed counts into refreshBackgroundWait() without holding foreground activeTurnAuthority, and reset on CLI spawn, stopScreenUpdates(), and conversation switches.

3. Expose activeTurnSilentSchedule on session rows and SSE (5127ae14)

  • Problem: Downstream boards (e.g. Topic Console) could not tell whether a working status was a pure silent scheduled poll vs interactive human/bot work.
  • Fix:
    • src/core/types.ts, src/core/silent-schedule-turns.ts, src/core/dashboard-rows.ts, src/core/worker-pool.ts, src/core/session-manager.ts, src/daemon.ts: track per-generation lastScreenTurnId and monotonic non-silent admission sequence (turnOrderSeq / lastNonSilentTurnSeq / silentScheduledTurnMeta), expose activeTurnSilentSchedule: true via isActiveTurnSilentSchedule() without clearing silentScheduledTurns, guard against stale/terminated frames and Web Terminal direct submits, and publish SSE session.update patches on transitions.

Verification

  • npm run typecheck (passed)
  • npx vitest run --project unit:
    • test/antigravity-folded-turn-authority.test.ts (11 passed)
    • test/antigravity-footer-background-tasks.test.ts (8 passed)
    • test/silent-schedule-turns.test.ts (13 passed)
    • test/background-wait-card.test.ts (44 passed)
    • test/antigravity-idle-composer.test.ts (36 passed)
    • test/antigravity-transcript.test.ts (36 passed)
    • test/worker-terminal-authority-release.test.ts (26 passed)
    • test/worker-turn-idle.test.ts (17 passed)
    • test/dashboard-aggregator.test.ts (24 passed)

@big-omega
big-omega force-pushed the fix/antigravity-turn-authority-and-runtime-status branch 3 times, most recently from af81d19 to 1bef7ba Compare November 24, 2026 15:10

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查结论

基于 PR head 1bef7ba28cbfcacf6197c8dd34cbd87fbcc6d69f 复核;本地仅将同一内容 rebase 到当前 master,三个提交的 patch-id 均不变。Antigravity transcript 回收与 footer 计数主路径未发现新的 P0/P1;但静默看板状态存在一个可达的 P2 生产误判。前述两个测试缺口均通过变异复验确认,另有一个 P3 元数据清理问题。

P2:非静默准入覆盖不完整,人工工作可持续被标成纯静默巡检

isActiveTurnSilentSchedule 依赖 noteNonSilentTurnActivity 推进序号(src/core/silent-schedule-turns.ts:85-92,99-152),但该登记只接入了部分入口。比如:

  • 失败卡 retry_turn 在 src/im/lark/card-handler.ts:4441-4475 生成新 turnId 并调用 sendWorkerInput,既没有调用 noteNonSilentTurnActivity,也没有更新 ds.currentTurnId;retry_last_task(同文件 :4236-4293)等路径形状相同。
  • 决策看板已有会话的非静默注入在 src/core/session-manager.ts:5652-5656 只有 input.silent 时 arm,没有非静默分支;这与同文件 :5306-5307 的定时续跑处理不一致。

真实 worker-pool 组件 + 模拟 worker IPC 的探针(会话 cliId=claude-code,故不限于 agy)复现序列:

  1. arm 一个静默回合并收到其 working 帧,SessionRow 为 activeTurnSilentSchedule=true;
  2. 以新 turnId 调 sendWorkerInput 模拟人工重试,返回 true(已准入);
  3. 立即重组 SessionRow,仍为 true;
  4. 再收到旧静默 turnId 的工作帧(type-ahead 折叠或滞后归因),仍为 true。

探针实际输出为 silentImmediatelyAfterAdmission=true、silentAfterAnotherSilentAttributedFrame=true。同一真值也驱动 src/core/worker-pool.ts:24566-24662 的 SSE patch,因此消费者不会及时收到 false。/quote(card-handler.ts:2610)本身更新了 currentTurnId,有序列外的 id 不一致兜底,仍只属于入口不一致;真正产生持续误判的是上述没有该兜底的入口。

建议在统一的真实准入边界处理非静默登记并发布状态翻转(send/fork 都覆盖,显式排除已 arm 的静默回合),而不是继续逐个卡片入口补漏;并加入“静默运行中人工重试准入后立即 false”的回归测试。此问题只影响新增看板/SSE 状态语义,不影响本 PR 的 agy transcript authority 回收与 footer 计数。

P2(测试缺口):两个生产守卫正确,但 PR 自带测试未钉住

  1. 非静默序号守卫:临时禁用 src/core/silent-schedule-turns.ts:141 的 lastNonSilentTurnSeq > meta.seq 判断后,PR 相关 4 个测试文件仍为 76/76 绿;直提后滞后帧重归因探针由 false 变为 true(咬红),恢复生产代码后转绿。
  2. directSubmit 非静默登记:临时禁用 src/core/worker-pool.ts:24466-24468 后,同样为 76/76 绿;无 terminal_input 前置、直接收到 directSubmit working 帧的集成探针咬红,恢复后转绿。

建议分别把这两个场景补进 test/silent-schedule-turns.test.ts 与 test/background-wait-card.test.ts。现有 background-wait-card.test.ts:776-789 在 directSubmit 前先发了 terminal_input,所以覆盖不到第二条独立登记路径。

P3:TTL 读路径只清 registry,新增的元数据可突破原有上限

src/core/silent-schedule-turns.ts:69-74 在 isSilentScheduledTurn 发现 TTL 到期时只删除 silentScheduledTurns,没有同步删除 silentScheduledTurnMeta(也没有清理同 id 的 latestSilentScheduledTurn)。假时钟连续执行 300 轮“arm → 读路径到期 → 下一轮 arm”后,实测 registrySize=0、metadataSize=300,绕过 MAX_SILENT_TURNS_PER_SESSION=256 的约束。增长较慢且不影响判定结果,故列 P3;建议到期路径复用统一的 disarm/清理逻辑,并用假时钟补边界测试。

验证

  • 恢复后的最终定向回归:上述 4 个测试文件 76/76 通过。
  • 上述两个变异下均为 PR 自带测试全绿、定向探针咬红;恢复后两探针转绿。
  • 人工重试生产探针在未变异代码上稳定复现上述两个 true。
  • bun run typecheck 通过;git diff --check 通过;所有变异与临时探针均已还原/删除。

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

补充审查:相同提示词回收存在 P1

对更多候选场景执行真实函数探针后,确认以下问题。前两项会把尚未消费的候选输入误判为 completed,调用方随后会删除队列并退役 turnId,存在跳过用户/定时输入的风险;因此需要更正上一条“未发现 P0/P1”的结论。

P1-A:前一条相同文本尚未落盘时,其 USER_INPUT + DONE 可冒充新候选

rememberSubmittedTurnText 在 literal write 前只采样当前 transcript size(src/worker.ts:6919-6940,26105-26107),而文本匹配只要求 lineFileOffset >= minByteOffset(src/services/antigravity-transcript.ts:1247-1275)。如果前一条同文输入的记录在采样后才落盘,它的记录和 DONE 也满足这个新下界。

真实 rememberSubmittedTurnText + findCompletedAntigravityTurnIds 探针:

  1. transcript 为空时为 schedule:new 采样相同静态提示词,得到 minByteOffset=0;
  2. 只写入前一条同文运行的 USER_INPUT + PLANNER_RESPONSE DONE,不写入 schedule:new 自己的输入;
  3. 实际返回 incorrectlyCompleted=["schedule:new"]。

src/worker.ts:8891-8905 会据此 dropQueuedTurnRecord / markTurnRetired。需要为每次提交绑定独立、可证明归属的 USER_INPUT occurrence,而不能把“采样后的任意同文记录”当作本次提交证据;应覆盖前一条记录延迟落盘的回归用例。

P1-B:compact/full 切换时直接混用两套字节坐标

采样时 resolveAntigravityTranscriptPath 可能选中 compact,prompt_ready 时却选中后创建的 full(src/worker.ts:6926-6937,8851-8852);full/compact 同记录的字节偏移不同,但比较时没有使用已有的 mapAntigravityCompactOffsetToFull。

探针先把一条完整同文运行写入 compact,再为新候选实际采样到 minByteOffset=1348;随后创建同一批历史记录的 full 视图。该条采样前已存在的 USER_INPUT 在 full 中起点为 5011,仅因坐标系不同就越过下界;候选没有新输入,实际仍返回 incorrectlyCompleted=["schedule:sibling"]。应同时保存采样文件类型,切换到 sibling 时先转换 offset,再与统一 transcript 的坐标比较;这一项与 P1-A 需要分别修,单做 offset 转换不能覆盖前记录延迟落盘。

P2:reattach 后,无 message_location 的定时回合仍无法完成回收

recentSubmittedTurnTexts 仅是 worker 内存 Map(src/worker.ts:6916-6918)。worker reattach 后,恢复的 schedule candidate 在 src/worker.ts:8872-8878 没有 submittedText;定时提示词又没有 Lark message_location,因此即使 transcript 已有该提示词的 USER_INPUT + DONE,真实查询仍返回 completed=[]。这会保留本 PR 试图消除的 queueAfterActiveTurn 卡死场景。

现有 reattach 测试 test/antigravity-folded-turn-authority.test.ts:421-452 只覆盖带 message_location 的 om_B/om_C,没有覆盖静态定时提示词。建议从 durable scheduled-input/marker 恢复正文与位置,或提供其他安全归属证据,并增加 reattach + schedule 的集成用例。

P2:空行被当成页脚边界,可把普通输出误报成后台任务

src/adapters/cli/antigravity.ts:226 接受空行作为 footer 上边界,与函数注释“带分隔线边界的真实页脚”不一致。真实解析结果:

  • prose\n\n? for shortcuts · 4 task(s) → 4
  • Allow this command?\n\n? for shortcuts · 2 task(s) → 2

这两类屏幕都没有原生 composer/分隔线证据,却会制造后台任务数;除看板误报外,src/core/idle-worker-sweeper.ts:226-228 等活 worker 守卫也会把输出文本当成真实工作。建议要求正向原生布局证据,不能只靠 blank boundary。

P2:静默回合已终态,screen-bound 分支仍可持续返回 active

src/core/silent-schedule-turns.ts:114-152 在 lastScreenTurnId 分支没有应用 latest-fallback 已有的 terminal guard。真实纯函数探针设置 live worker + working、当前代际的静默 screenTurnId,以及同 turnId 的 lastTurnTerminalStatus=completed,结果仍为 active=true。

turn_terminal 在 src/core/worker-pool.ts:26588-26596 只记录 terminal 并调度卡片兜底,没有清理 screen binding 或发布该字段;2 秒兜底在 :7215-7217 也明确是 display-only,不更新 dashboard 执行态。因此没有后续 idle screen 时,该错误不会由现有兜底消除。建议对 screen-bound turn 同样排除已终态记录,并在精确 terminal 到达时清理/发布 false。

P2:worker 退出与部分非静默准入的 SSE 补丁不完整

真实 worker-pool exit 探针的实际结果是:

{
  "rowSilent": false,
  "silentFalsePatch": false,
  "rowBackgroundTasks": 2,
  "backgroundClearedPatch": false
}

新组装的行因 worker=null 已不再静默,但 src/core/worker-pool.ts:28711-28717 只发布 webPort/workerPid,已连接客户端按 patch 合并,仍保留 activeTurnSilentSchedule=true。同一处的 backgroundTaskCount 未清是既有清理缺口,新 agy footer 来源也会继承;建议统一在 generation retirement 清理并发布。

另一个同类点是 src/core/session-manager.ts:5307:非静默 scheduled continuation 会推进序号、让新组装的行变 false,但没有像 beginNewTurn / terminal_input 一样发布 false patch;无后续 screen frame 时 SSE 同样滞留。建议把这些状态迁移收敛到共享的发布辅助函数。

补充验证

以上结果均来自未变异生产代码的真实函数/真实 worker-pool 组件探针;临时文件已删除,生产工作区无 diff。前一条中的 76/76 定向测试与 typecheck 结论不变,这些场景正是当前测试未覆盖的缺口。

@big-omega
big-omega force-pushed the fix/antigravity-turn-authority-and-runtime-status branch from 1bef7ba to 316e004 Compare November 24, 2026 16:48
@big-omega

Copy link
Copy Markdown
Contributor Author

感谢细致审查,三条意见已全部收敛到最新 commit 316e0043(已 rebase 到 master 3af34929):

  1. P2 非静默准入统一收敛到 worker-pool 真实准入边界

    • 移除原先散落在 src/daemon.ts 和 src/core/session-manager.ts 的零散 noteNonSilentTurnActivity 调用。
    • 在 src/core/worker-pool.ts 新增 noteAdmittedTurnSilentScheduleState,统一挂在真实准入边界:sendWorkerInput、admitQueuedActivationTail、promoteQueuedActivationTail、forkWorkerPrepared、forkAdoptWorker、readonlyTaskContinuation 以及 sendWorkerSessionInput 的 raw_input/inject_command 路径,显式排除已 arm 的静默回合(Boolean(turnId) && isSilentScheduledTurn(ds, turnId)),非静默准入时立即推进序号并发布 SSE activeTurnSilentSchedule: false;suspendWorker 同时清理 latestSilentScheduledTurn。
    • 在 test/background-wait-card.test.ts 新增回归用例:静默运行中通过 sendWorkerInput 准入不改 ds.currentTurnId 的人工重试回合,立即验证 composeRowFromActive 清除标记、SSE 立即收到 { activeTurnSilentSchedule: false },且后续滞后静默帧仍保持非静默。
  2. P2 补齐两条生产守卫的防变异单测

    • test/silent-schedule-turns.test.ts:新增在 ds.currentTurnId 与 meta.currentTurnIdAtArm 保持一致、仅靠 lastNonSilentTurnSeq > meta.seq 拦截滞后静默帧重归因的用例。
    • test/background-wait-card.test.ts:新增无前置 terminal_input、直接收到 directSubmit: true 工作帧即翻转 activeTurnSilentSchedule: false 且后续滞后静默帧不回弹的独立用例。
  3. P3 TTL 读路径与淘汰路径元数据清理

    • src/core/silent-schedule-turns.ts 的 isSilentScheduledTurn 到期分支复用 disarmSilentScheduledTurn,pruneSilentScheduledTurns 同步清理过期或淘汰的 latestSilentScheduledTurn。
    • test/silent-schedule-turns.test.ts 新增 300 轮 TTL 到期读路径与容量上限边界测试,确认 silentScheduledTurns、silentScheduledTurnMeta、latestSilentScheduledTurn 全部归零且不超过 256 上限。

本地验证:npm run typecheck、git diff --check origin/master..HEAD 及 8 个相关测试文件(silent-schedule-turns、background-wait-card、worker-suspend、card-handler-retry-turn、failed-turn-retry、deferred-schedule-settlement、antigravity-folded-turn-authority、antigravity-footer-background-tasks,176 passed / 5 skipped)全部通过,等待本轮 CI 结果。

@big-omega
big-omega force-pushed the fix/antigravity-turn-authority-and-runtime-status branch from 316e004 to fb310f9 Compare November 24, 2026 17:05
@big-omega

Copy link
Copy Markdown
Contributor Author

已看到补充审查意见,6 项问题已全部按 commit 收敛并重推(新 head fb310f97:46b0e5bc / bf9c9da6 / fb310f97,基于 master 3af34929):

Commit 1 (46b0e5bc):折叠回合回收

  1. P1-A 延迟落盘冒充:
    • rememberSubmittedTurnText 在提交前除采样 sampledTranscriptPath 与 minByteOffset 外,还检查同一会话内更早未退休且尚未落盘到 minByteOffset 之前的同文/未知正文在途回合数,计算 skipPriorMatches。
    • findCompletedAntigravityTurnIds 对纯文本候选实行 1-to-1 occurrence 独占归属并跳过前 skipPriorMatches 条命中,同时对携带不同 <message_location> 的 USER_INPUT 拒绝对纯文本候选开放。
    • 新增回归用例验证:空 transcript 下前一条同文回合延迟落盘 USER_INPUT + DONE 不会误判 schedule:new 完成,只有第二条独立 occurrence 落地后才回收。
  2. P1-B compact/full 坐标切换:
    • 采样时记录 sampledTranscriptPath;resolveAntigravityCandidateMinByteOffset 在 compact -> full 视图切换时调用 mapAntigravityCompactOffsetToFull 换算偏移,其余无法安全对齐的跨文件偏移一律 fail-closed。
    • 新增 compact→full 偏移换算回归用例。
  3. P2 reattach 后无 message_location 的定时回合回收:
    • writeCliPidMarker 将紧凑的 antigravityReconcileHint(仅含正文 textSha256、sampledTranscriptPath、minByteOffset、skipPriorMatches,不落盘明文)持久化到 PID marker 的 head 与 queuedTurns,reattach 时从 marker 恢复并交由 findCompletedAntigravityTurnIds 按摘要校验。
    • 新增 reattach + 静态定时提示词完整集成用例。

Commit 2 (bf9c9da6):Antigravity 页脚后台任务数

  1. P2 空行边界误报:
    • parseAntigravityFooterBackgroundTasks 不再把任意空行视为页脚上边界:要求页脚紧上方为真实分隔线(/^[─━]{4,}$/),或(兼容 PTY rawSnapshot 去盒画字符场景)空行上方具备正向原生空输入框证据(readyComposerRowAbove);同时拒绝无上边界的裸页脚行。
    • 补齐 prose\n\n? for shortcuts · 4 task(s)、Allow this command?\n\n? for shortcuts · 2 task(s) 拒绝用例与 rawSnapshot 原生空输入框正例。

Commit 3 (fb310f97):activeTurnSilentSchedule 投影与 SSE

  1. P2 screen-bound 静默回合终态仍返回 active:
    • isActiveTurnSilentSchedule 对所有解析出的 executingTurnId(含 lastScreenTurnId 分支)统一排除 lastTurnTerminalStatus/lastTurnTerminalTurnId 以及 terminalIdentityTurnIds 已终态记录。
    • worker-pool.ts 的 turn_terminal 分支精确清理该回合的 screen binding / latestSilentScheduledTurn 并在状态翻转时立即推送 SSE { activeTurnSilentSchedule: false }。
  2. P2 worker 退出与准入 SSE 补丁完整化:
    • worker exit(以及 claude_exit / suspendWorker)统一清理 backgroundTaskCount、lastScreenTurnId、lastScreenTurnGeneration、latestSilentScheduledTurn 和 lastPublishedActiveTurnSilentSchedule,并在退出补丁中携带 backgroundTaskCount: null 与 activeTurnSilentSchedule: false(仅在原先非空/为 true 时附带,保持非静默/无后台任务路径 patch 精确兼容)。
    • session-manager.ts:5307 已由上一轮统一收敛到 worker-pool.ts 的 noteAdmittedTurnSilentScheduleState 准入边界并即时发布 SSE。

本地验证:npm run typecheck、git diff --check origin/master..HEAD 及 9 个测试文件(192 passed / 5 skipped)全部通过,等待 CI 跑完。

@big-omega
big-omega force-pushed the fix/antigravity-turn-authority-and-runtime-status branch from fb310f9 to b089d32 Compare November 24, 2026 17:54
Antigravity folds type-ahead messages into an active run and settles them together before returning to idle. In normal send mode without per-turn transcript terminals, a lagging PID marker or queued type-ahead record could re-acquire activeTurnAuthority for an already-completed turn at prompt_ready, blocking later queueAfterActiveTurn schedules indefinitely.

Check native Antigravity transcript consumption and non-tool PLANNER_RESPONSE completion (fail-closed while busy, non-durable turns only) before ready settlement so completed folded turns are retired without disturbing live successors, durable retries, or the queued-ready-transition contract. Also log active-turn deferral truthfully instead of Writing to PTY.
In normal botmux-send mode Antigravity does not run the structured transcript bridge, so active background commands and schedule timers reported in its native footer (? for shortcuts ... N task(s) / esc to cancel ... N task(s)) were not surfaced via screen_update.backgroundTasks.

Parse the viewport-tail native footer conservatively (requiring the real footer boundary, preserving the last count when no footer is visible, and clearing to 0 when the footer drops task(s)), fold it into refreshBackgroundWait without holding foreground activeTurnAuthority, and reset on respawn, stopScreenUpdates, and conversation switches.
Track the currently executing screen_update turn and worker generation on DaemonSession so consumers can distinguish a pure silent scheduled poll from interactive or non-silent work without clearing the silentScheduledTurns suppression registry.

Centralize non-silent turn admission tracking at the real worker-pool admission boundaries (sendWorkerInput, forkWorker, forkAdoptWorker, queued activation tail, direct raw_input/inject_command, and readonly task continuation) so card retries, decision-board injections, and direct submissions immediately clear activeTurnSilentSchedule and emit SSE patches. Also clean up silentScheduledTurnMeta and latestSilentScheduledTurn on TTL expiry and eviction.
@big-omega
big-omega force-pushed the fix/antigravity-turn-authority-and-runtime-status branch from b089d32 to b99e304 Compare November 24, 2026 18:23

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在作者最新 head b99e3048 基础上追加两个增量提交:

  • c019e8c8:retireWorkerProcessOnly 同步清理并发布静默运行态与后台任务数,覆盖其先清空 ds.worker、导致后续 exit 事件无法进入清理分支的路径。
  • d152a45d:advanceAncestorSessionTurn 保留提升回合与剩余 queued turns 的 antigravityReconcileHint,任一可选字段非法时拒绝整份 hint,避免外部推进后 reattach 静态定时回合失去归属证据或从 byte zero 误配同文旧记录。

作者 head 已包含 P1/P2/P3 的主体修复;本次验证覆盖了同文延迟落盘、compact/full 偏移换算、reattach、页脚边界、终态/退出及 TTL 元数据。新增测试分别验证 process-only retirement 和 marker hint 保留,两个对应变异均咬红后恢复。

验证结果:

  • bun run build 与 typecheck 通过。
  • 最终组合 vitest:3 文件 97 项通过;transcript/scheduler/terminal 另 6 文件 861 项通过。
  • Bun runtime:3 文件 64 项通过。
  • marker:34 项通过(已含在上述 97 项中)。
  • 完整 vitest unit 已启动,结果将另行补充。
  • 独立对抗复核发现并已关闭一个 P2:合法 hash 搭配非法 offset 曾被削弱为从 byte zero 匹配,现已改为整份 hint 拒绝;同一独立上下文复验 completed=[],process-only retirement、合法 hint 保留、错误 consumed turn 不推进及截断 marker 保护均通过。

影响面:未改动作者的 occurrence 算法;新增改动只涉及通用 worker 退役时的 dashboard 状态清理,以及 agy marker 元数据透传。其它 CLI 只共享退役清理路径,不改变执行/投递协议。

最新作者 rebase 已消除与 master 的冲突;GitHub 当前显示 MERGEABLE。

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

补充完整 vitest unit 结果(最终 head d152a45dbb):

  • 总结:exit code 1;52 个测试文件、140 项测试失败;3021 个文件、60839 项测试通过,188 项跳过。
  • 失败清单不包含本次修改的 test/background-wait-card.test.ts、test/session-marker-resolve.test.ts、test/antigravity-folded-turn-authority.test.ts 等新增/直接相关测试;这些文件已在最终 head 上单独全部通过。
  • 两条 restart-reattach-antigravity.integration.test.ts 失败均在首个 worker ready 之前,日志明确为 tmux socket File name too long,尚未进入本 PR 的回收/reattach 逻辑。其它多数失败也呈真实 tmux/bwrap/权限/CLI 启动或网络夹具形态;未把这些环境失败归因于本 PR,但也未逐项把所有 140 项都证明为基线问题。

因此完整 unit 不是绿的,不能写成全量通过。合码判断应使用定向回归、独立对抗复核及 CI 分片结果,而不是把本次完整运行忽略掉。

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI 已全部通过(d152a45d → 7d23ef7a5a):

  • run 45472698418 attempt 2 的最终结论为 success,build、network-boundary、全部二进制、4 个 vitest shard 和 4 个 Bun shard 均为 pass。
  • test (1/4) 的 topic-index SQLite database is locked 首次失败未涉及本 PR 文件;该文件本地复跑 29/29 通过后,按 Re-run failed jobs 重试,shard 已通过。
  • macOS hosted pool 首次未分配 runner 导致的 Darwin 取消,在新 head 的 run 中已通过。
  • GitHub 当前 head 为 7d23ef7a5a7c627c9e56563ddd0cc4db169a2515,状态为 OPEN MERGEABLE。

本地之前因超长 tmux socket 路径产生的集成失败与 CI runner 的路径环境不同,未据此判定 PR 回归;上述 CI 结果才是本 head 的完整分片结果。

…-status

Sync PR deepcoldy#3799 with latest master (through deepcoldy#3798); combined tree == merge-tree
prediction bf48da1, typecheck/build and 464 related tests pass locally.

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

合并增量复审(head b443bafdf96c16a9d353a3d125cf5866ece1ff3a):

  • 父提交为 7d23ef7a5a 与 1987742097;git merge-tree --write-tree 预测为 bf48da1c992cfa57675b52b2034c58cb46bea4df,与合并提交实际 tree 逐字一致,未发现手工改写。
  • 重点核对了 #3800 的 type-ahead prompt sidecar 注册/清理与本 PR 的 reconcileHint:两条路径职责不同,未发生 hint 字段丢失或序数归属改写。#3791 的忙碌证据读取与本 PR 的 compact/full offset 映射也未见接口冲突。
  • 合并树 vitest:16 个相关测试文件 357/357 通过;Bun 腿 4 个文件 72/72 通过;typecheck 通过。
  • 覆盖 P1-A 延迟落盘、P1-B 坐标换算、marker hint 持久化/非法字段拒绝、process-only retirement、退出契约,以及 #3800/#3791/#3782 的相邻流程。

代码侧未发现新的阻断问题。CI 首跑仍在途,另以 CI 状态为准,不在此处提前标记通过。

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

合并增量复审(head b443bafdf96c16a9d353a3d125cf5866ece1ff3a):

  • 父提交为 7d23ef7a5a 与 1987742097;git merge-tree --write-tree 预测为 bf48da1c992cfa57675b52b2034c58cb46bea4df,与合并提交实际 tree 逐字一致,未发现手工改写。
  • 重点核对了 #3800 的 type-ahead prompt sidecar 注册/清理与本 PR 的 reconcileHint:两条路径职责不同,未发生 hint 字段丢失或序数归属改写。#3791 的忙碌证据读取与本 PR 的 compact/full offset 映射也未见接口冲突。
  • 合并树 vitest:16 个相关测试文件 357/357 通过;Bun 腿 4 个文件 72/72 通过;typecheck 通过。
  • 覆盖 P1-A 延迟落盘、P1-B 坐标换算、marker hint 持久化/非法字段拒绝、process-only retirement、退出契约,以及 #3800/#3791/#3782 的相邻流程。

代码侧未发现新的阻断问题。CI 首跑仍在途,另以 CI 状态为准,不在此处提前标记通过。

@deepcoldy

Copy link
Copy Markdown
Owner

合并 head b443bafdf96c16a9d353a3d125cf5866ece1ff3a 的 CI 首跑已全部通过:

  • run 45506483594、attempt 1 最终状态为 completed / success,head SHA 与本次复审提交一致。
  • build、network-boundary、Linux/Darwin/musl 二进制、4 个 vitest 分片、4 个 Bun 分片及聚合检查均为 SUCCESS;本 run 无需重跑。
  • 当前工作区干净,仍停在该合并提交;未执行合码。

@deepcoldy
deepcoldy merged commit 8792e56 into deepcoldy:master Nov 25, 2026
15 checks passed
@deepcoldy

Copy link
Copy Markdown
Owner

感谢 @big-omega 高质量的实现与多轮配合,已 squash 合入 master(8792e56709)。

这条链路最终的关键修复——用带 SHA-256 摘要、采样文件坐标和 skipPriorMatches 序数的 reconcileHint(随 PID marker 持久化、非法字段整份拒绝)解决同文延迟落盘误回收与 compact/full 坐标混用,fail-closed 边界和测试覆盖都很扎实;reattach 静态定时、非静默统一准入边界、退役状态清理、TTL 元数据清理也都收敛干净。

本 PR 评审提出的问题已全部闭合,无遗留 follow-up。评审中暴露的 CI 偶发(topic-search-index-store 在高负载 runner 上 SQLite database is locked)与本 PR 无关,已另开 #3812 跟踪根治。期待后续继续贡献。

@github-actions

Copy link
Copy Markdown

🚀 Released in v3.59.32

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.

3 participants