Repository navigation
Conversation
eric8810
left a comment
There was a problem hiding this comment.
复核 4796e2b3。Global/CN/Alpha 和隔离 home 的提醒已与 #2454 对齐;会话由所有者暂存并一次发布、回执同事务的方向也清楚。
P2:把显式关闭和升级的 idle-only 关闭分开,并明确谁负责先结算 Migration。 合同 把关闭与更新重启都写成等待迁移事务后落盘 interrupted。但 CLI 升级 只发 daemon.shutdown {ifIdle: true},活动迁移持有的 processActivity 正应让这次请求拒绝,而不是中断任务。对于明确要求关闭的路径,现有 App Server 协调器 先 quiesce Provider,再等 Agent/RPC,最后才进树的 shutdown;仅有 hold 与行卸载回调不能保证迁移先停止接单、在业务所有者仍可用时结算并保存终态。
建议保留现有升级语义:繁忙时拒绝并让任务继续;将 interrupted 留给显式关闭或实际发生的受控停止。请在设计中指出复用或新增的关闭协调点及其相对所有者的顺序,并把「迁移中点升级,拒绝且继续」和「显式关闭,已接单对象结算后落盘 interrupted,再拆所有者」列为两个独立验收。这里只要求把设计合同定清楚,不要求本 PR 实现。前台延迟和 RSS 可按当前建议作为实现阶段的预算验证。当前设计 CI 已通过。
|
Addressed in |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Review: PR 2455 at d50cbbb
This PR defines the daemon-owned online v2 migration contract: Migration runs as a process plugin, each target owner publishes its own data and receipt, and CLI and local Web share one task ledger and one set of migration.* management methods. The new head keeps the design's earlier scope and ownership decisions, and it resolves the prior blocking shutdown point.
Shutdown and upgrade now separated
Point 4 follows the existing idle-only upgrade contract. stop_idle_for_update sends daemon.shutdown {ifIdle: true} (crates/dim-cli/src/client.rs:755-811), and an active migration processActivity hold makes the daemon answer daemon_busy (crates/dim-app-server/README.md:471-483), so the task continues under the same ID and the upgrade exits with the existing busy message. Point 5 handles explicit normal shutdown without ifIdle. The new App Server coordination paragraph places owner settlement before Provider quiesce, Agent settlement, RPC drain and tree unload, which matches the current coordinate order (crates/dim-app-server/src/lib.rs:1777-1809). The acceptance now has separate cases for upgrade refusal and explicit-shutdown settlement. This fully resolves the earlier shutdown objection.
The exact coordinator hook remains for the App Server owner to confirm, as the design states. The design supplies the required ordering and the ownership split, so this is a confirmation item, not a missing contract.
Verified
AgentBuilder::optional_pluginis an existing assembly hook (crates/dim-agent-scheduler/src/lib.rs:98,crates/dim-event-hub/src/lib.rs:111), andmanagementMethods,processActivity,fileStorageandfsHostare existing faces.SqliteStorage::open_reportingholds<database>.sqlite.lockfrom open to close (crates/dim-app-server/src/storage/sqlite.rs:1602-1645), so the daemon's lock authority and the offline adapter'sNative::openlease do not coexist.copy_snapshotcurrently reads the whole file (crates/dim-migration/src/source.rs:1253-1261), fork chunks 256 logical sequence numbers (docs/design/appserver/native-storage-format.md:444), and the writer busy handler is about five seconds (crates/dim-app-server/src/storage/sqlite.rs:1525). The fixed-buffer copy and foreground budgets target the right constraints.- The eight
migration.*methods, the Web entry allowlist, the CLI binding, the owner-operation anchors and the owner docs agree.git diff --check origin/main...HEADis clean. - The design covers the earlier #2454 points: lifecycle and lock ownership, explicit shutdown, measurable p95/max and RSS budgets, and Global, Alpha and isolated-home scope.
P3, optional: state the no-daemon behavior of query commands
Problem. The proposed online binding says the explicit command connects to or starts the target daemon for start and retry. It does not say whether list, show, cancel or inspect also start a daemon or require a running one.
Failure scenario. After a reboot, dimcode migration list could start a daemon and open the native store only to list tasks. The current offline binding says queries and inspection do not open that database. The online design should say which behavior it chooses.
Evidence. docs/design/cli-commands.md:2681; docs/design/plugins/Migration.md:162 and :166.
Fix. Add one sentence to the online binding: these commands either require a running daemon, start one, or read the ledger without opening the native store. Add the chosen case to the CLI acceptance list.
Cross-PR
No other open PR changes these migration sections. #2345 also edits docs/design/cli-commands.md in the thinking-rendering section, so the file is shared but the sections do not overlap.
CI
Docs-only checks at this head: changes, evaluate-pr and issue-gate pass; macos-native and verify (linux) were still running when this review was written; code jobs skip. No tests were run for a docs-only change.
Verdict: APPROVE. The shutdown contract is split correctly, the coordinator ordering is explicit, and no blocking defect remains.
| exit. There is no persistent Migration selection or automatic trigger. Imported | ||
| business configuration takes effect through normal feature loading. | ||
|
|
||
| **Proposed online binding ([Migration](plugins/Migration.md#在线任务合同提案)).** Keep the channel routing, flags, foreground wait, per-home report or distribution envelope, and exits above. The explicit command connects to or starts the target's normal native daemon and calls `migration.start`/`retry`, then reads status and the paged report for that ID. Ctrl+C explicitly requests `migration.cancel` and waits for settlement. A transport disconnect only loses the observation. Reconnect and query the accepted task before deciding the exit code. `interrupted`/`failed` return 1. `list/show/cancel` retain their existing JSON shapes (`cancel` returns a task report). `--source-stopped` still supplies the operator's confirmation for scripts. The confirmation asks only about legacy writers. A missing online method is reported without opening the target database independently. The terminal example below shows the current offline prompt. |
There was a problem hiding this comment.
State whether list, show, cancel and inspect require a running daemon, start one, or read the ledger without opening the native store. After a reboot a read-only query could otherwise start a daemon and open the database, which the current offline binding avoids. See docs/design/plugins/Migration.md:162 and :166.
There was a problem hiding this comment.
Addressed in ad02e518189f62a67f51dcd4f97031413e3ad70d. The proposed CLI contract keeps list and show available after a reboot by reading the migration ledger locally. A running record whose lease has ended is displayed as interrupted. inspect reads a temporary source snapshot after the operator confirms that the legacy writers have stopped. These queries leave the target daemon stopped and the target database closed.
cancel asks the live task owner to stop. If the daemon is down, a terminal or interrupted task returns its existing report. For a still-held lease whose owner is unreachable, the proposal is to return an error and leave the cancellation intent untouched. Does that last case match the behavior you expect? The new acceptance case covers both ledger formats, the JSON output and the absence of task-record mutations. CLI contract
There was a problem hiding this comment.
Fixed in ad02e51. The live-lease case is correct as written: with no reachable owner there is no one to observe a new cancel intent, so writing the marker would leave a stale intent behind. Returning the error and leaving the intent untouched lets the user retry once the owner is reachable, and the new acceptance checks that the task record and cancel intent are unchanged.
There was a problem hiding this comment.
Fixed in a86148a: docs/design/cli-commands.md:2820 now states that list, show and cancel connect without starting a daemon, stopped-daemon reads use the private ledger, and inspect runs locally.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Review: PR 2455 at ad02e51
This design PR defines the daemon-owned online v2 Migration contract. The new head only clarifies the stopped-daemon behavior of list, show, cancel and inspect, and adds coverage for it. The rest of the d50cbbb design is unchanged. The prior optional P3 is resolved, and the earlier shutdown P2 remains resolved.
Stopped-daemon behavior
The new CLI paragraph is consistent with the existing primitives:
runandretryuse the target daemon or start one.list,showandcanceluseconnect_inner(..., start=false), which returnsNoneinstead of starting a daemon when none is running (crates/dim-cli/src/client.rs:1058-1071).- With no daemon,
listandshowreadmigration/tasksthrough the format 1/2 reader without opening the target store.Ledger::statealready projects arunningrecord whose run lease is free asinterruptedin memory, without saving it (crates/dim-migration/src/ledger.rs:79-96);listandreportreuse that projection. cancelon a terminal or interrupted task returns the existing report and writes no marker.Migration::cancelonly writesmigration/tasks/<id>/cancelwhen the report isrunning(crates/dim-migration/src/lib.rs:234-240), so the local stopped-daemon path can return the report without touching the intent.- A live lease with no reachable owner returns an error and writes no marker. That is the right choice: an intent no live owner can observe would remain as a stale cancel, while the user can retry once the owner is reachable.
inspectremains local, requires the legacy-writer confirmation, and uses the existing source snapshot scan without opening the target store or creating a task (crates/dim-migration/src/lib.rs:242-274).- The new acceptance bullet covers both ledger formats, single-home and distribution JSON, lost-lease interruption, cancel on the interrupted task, the unreachable-owner error, and the no-mutation guarantee. It also states that the four commands neither start a daemon nor open the target database.
The Web entry has no local filesystem path and still admits only the eight migration.* methods, so this local-only behavior does not widen the Web allowlist.
Verified
- The eight
migration.*methods, the owner-operation anchors, the source matrix and the shutdown split are unchanged from d50cbbb. git diff --check origin/main...HEADis clean. The changed links and anchors resolve.- CI at this head: changes, ci-ok, evaluate-pr, issue-gate, macos-native and verify (linux) pass; other code jobs skip. No tests were run for this docs-only change.
Cross-PR
#2459 also edits docs/design/cli-commands.md and docs/design/plugins/Scheduler.md, but in the wakeup retirement sections. This PR's migration section and Scheduler conditional-import paragraph are separate from those changes.
Prior points
The d50cbbb shutdown P2 remains resolved. The prior P3 on no-daemon behavior is resolved by ad02e51. No other old point needs withdrawal.
Verdict: APPROVE. The stopped-daemon contract is explicit and consistent with the existing ledger, cancel, connect and source-snapshot primitives.
|
@eric8810 请复审 本机 CLI 的报告第一页也固定了旧格式任务头和本次读取的对象视图。PR 正文中的三条评审项已链接到对应合同。 |
|
已记录 |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
APPROVE
The new commit f365d80 closes the round-1 optional P3 and pins the entry-scoped behavior that was only hinted at before. It adds the trusted-entry scope model, the CLI task-record shapes for online and offline reads, and the shutdown/reconnect contract. I checked it against the four touched files and the referenced contracts.
Entry scope is coherent. Migration.md now states that the native socket sees every task of the target while the local Web entry sees only host-recognized pairs, that a Web query for a custom-source or unknown task answers not_found (matched by the acceptance case that the task stays untouched), and that clientKind cannot widen the scope. The mechanism is spelled out in management-methods.md (Rpc supplies MethodCall.origin.entry, name local for the native socket and web for the loopback entry, derived from the transport), and web-workspace.md moves path and target-override rejection to entry admission while the owner checks task IDs and cursors inside the scope. The A.1 dependency is real and honestly labeled: the grammar at session-boundary.md:203 defines origin.entry and the document states twice (lines 231, 637) that it is not implemented yet, so both proposal files marking it as required-and-unimplemented is accurate, not a dangling claim.
The read shapes are consistent across the two client documents. migration.list returns CLI task records on the socket and status.task summaries on the Web; the report's first page on the socket carries the same read-only view's task record while Web reports carry only object pages and a cursor. cli-commands.md composes show, cancel and the waiting commands from that same first-page record plus all object pages of the view, and the acceptance bullet now checks format: 1, the null rules, the retryOf omission and the fixed first-page view while paging a live task.
The reconnect contract is uniform. The shutdown section, the CLI command paragraph, the Web workspace paragraph and the terminal diagram all describe the same pair of cases: a status poll answered with -32603 (Server is shutting down) before dispatch, or a dropped connection; both show "Waiting to reconnect", re-query the original task ID, and map waiting-command exit codes from the durable terminal state. The service_reloading code now points at the admission-stopping phase, with the shutdown-flow RPCs deferred to the shutdown section, so the two codes no longer overlap textually.
Prior points: the round-1 optional P3 (online list/show/cancel/inspect behavior) is now specified and is withdrawn; inspect remains a local read by design. eric8810's shutdown-vs-upgrade separation and the coordinator ordering (4796e2b CR) stay as fixed in the earlier rounds, and this commit does not regress them; the upgrade-busy and explicit-shutdown acceptance cases remain separate. zerob13's only thread on the PR (inline 4764925134 area) is already closed by the ad02e51 fixes and needs no further reply. The Migration design document is the single Chinese source; the touched English files have no Chinese twins, so there is no cross-language drift.
CI at the head: changes, evaluate-pr, issue-gate and macos-native pass; verify (linux) was still running at review time. The PR remains docs-only.
Verdict: APPROVE. The entry-scoped contract, the read shapes and the reconnect behavior are mutually consistent and the A.1 dependency is explicit.
Simon-He95
left a comment
There was a problem hiding this comment.
APPROVE
Reviewed f365d800 against current main. The design direction is correct and stays inside the existing ownership model: Migration remains a process plugin, sqliteStorage/SessionStore keep the native lock and publish the Session, each business owner validates and conditionally commits its own data and receipt, and the new migration.* methods are additive management methods registered through managementMethods. It does not add a second session store or a migration-specific Timeline path. The plan also explicitly marks the unimplemented origin.entry and the App Server shutdown coordination point as proposals for their owners instead of writing around them, which is the right boundary.
No blocking issue for the design PR. Please clarify these before implementation:
-
Mixed response shapes for
migration.list/migration.report. The table says the local socket returns the CLITaskStatewhile the authenticated Web entry returns thestatus.tasksummary, and the report first page follows the same split. One method returning two shapes by transport makes the management contract harder to type and test. Either state a single envelope with an entry-scoped optionaltask/sourceprojection, or split the Web projection into its own method name; if the split is deliberate for path/secret redaction, say that in the table and add a test that the Web shape cannot carrysourceHome/current/raw paths. -
Receipt owner and deletion semantics need one explicit matrix. "原生格式与提交" says the online path still recognizes the existing
migration/session/<digest>,migration/settings/<source>,migration/schedule/<digest>, Provider coverage and accountmigration:{id}records, and says the target owner saves/verifies them at its own write boundary. But it does not say where the online receipt physically lives for each target, which owner writes it in the same transaction, and how it survives deletion of the Session, Provider or schedule. The per-owner operations inresource-owner-operations.mdimply the target owner's storage; make that explicit (owner, key, atomic write, delete behavior) so "target deleted, retry reports deleted" has a defined home for every kind. -
State the Web display/path boundary once. The design says paths are display values supplied by the host and reports omit raw contents/credentials. Please make the same statement for
migration.noticepair labels andmigration.statusdiagnostics, and add the acceptance check that the Web entry never receives a customsource.path, a raw path, or an occupier task ID it is not allowed to see. -
Implementation follow-ups: the current offline
migration run/retrystill stops the daemon and takes the exclusive lock; the online binding must preserve the documented flags, JSON and exit codes while switching to the daemon-owned path. The design says this, but the implementation PR should include the script-compatibility fixture (format 1 ledger,interrupt/cancel/retry) and thedaemon_busyupgrade case described in the acceptance list.
The existing tested surface is otherwise coherent: processActivity holds, per-task cancellation, idempotent start by requestId, prepare/stage/publish/discard, source confirmation and the stopped-daemon read path all have explicit owners and failure behavior. I would approve the contract with the clarifications above folded in.
The module now has its process part: a plugin row whose methods are a `#[rutis::service]` block, so the face is served by name with a catalog name and any TypeScript or Python row reaches `preview` and `apply` as data, without a hand-written dispatch. `preview` serves the module's validation and plan. `apply` answers `publish_unavailable`: publishing an imported Session belongs to SessionStore (design §7, arcships#2455), and the module does not add a second publish path. The row is not mounted in a product profile yet. Refs arcships#2585
eric8810
left a comment
There was a problem hiding this comment.
复审 f365d800。上轮关于两种关闭混在一起的意见已解决:空闲升级返回 daemon_busy,同一任务继续;显式关闭由 App Server 协调,在 Provider 停用、Agent 结算和 RPC 排空前等待 Migration 完成已接单写入并持久化终态。已认证的入口仍由 App Server 提供,Migration 据此筛选,客户端不能用 clientKind 扩权。
Design · Blocking:迁移的进程接纳必须覆盖后台任务,而不是 start/retry RPC。 当前合同 仍要求公开 hold() / release(holdId);#2021 的已定更正 用 keep(work) 取代它们。如果只把受理 RPC 包进 keep,返回任务 ID 或客户端断开就会释放接纳,迁移还没结算,下一次空闲升级却可能成功。请让 Migration 拥有独立于 RPC 和观察者的任务,覆盖接纳、受理落盘、执行、写入结算和终态;受理应答等落盘确认,不等任务跑完。调用未获接纳时不得开始迁移或写入 running。显式关闭的协调点仍由 App Server 所有者确认,不把它写成已生效机制。
验收:任务已受理后断开 CLI/Web,ifIdle 仍答忙且同一 ID 继续;反过来若空闲关闭已占先,回调不执行、不产生 running;显式关闭则在业务所有者停用前保存终态,重连按原 ID 读得到。这里是设计复审,未跑实现;未查到这个 head 的 GitHub CI run。
|
Updated in Both orderings are now explicit acceptance cases. The App Server coordination point for explicit shutdown remains a proposal for its owner to confirm. I checked the contract and local links, and the ADR freeze and diff checks passed. This is a design change; the runtime cases are specified for the implementation PR. Acceptance cases · Review addressed |
There was a problem hiding this comment.
REQUEST_CHANGES
Round 4 review of 589032523c1f7e97b3ff311fb86e14534695ed07 against origin/main 6ee758ad61b4ba13f2972fe8cae19eef26efaaab. The delta f365d800..58903252 is one docs commit, 9 insertions and 7 deletions in docs/design/plugins/Migration.md; it adopts #2021's processActivity.keep(work) contract. The admission model in the new step 2 and its acceptance case does not match the current process-activity contract.
Design
Blocking: keep cannot return paused to a start or retry caller
Layer. Design (admission ownership conflicts with the process-activity contract).
Root cause & same-source scope. Step 2 and the acceptance case say idle shutdown can pause admission before the start/retry background task calls keep, and that keep then returns paused (docs/design/plugins/Migration.md:181, :223). But every non-shutdown RPC holds process admission from dispatch until its response (crates/dim-app-server/src/connection.rs:438-446, :508-511), and idle shutdown pauses admission only at count zero (crates/dim-app-server/src/control.rs:99-103). While the RPC waits for {taskId}, its hold prevents the pause; if admission is already paused, the RPC is refused at dispatch (connection.rs:444-445) and keep is never called.
Failure path. The documented paused response and its test cannot occur for start or retry. An implementation following this text carries an unreachable branch and a test that cannot reproduce it; the observable refusal happens at RPC admission, before Migration.
Acceptance. Remove the paused path and that case from the start/retry flow, or state the admission scope that makes it reachable and update the test. Keep the reachable case: an already paused admission refuses the RPC at dispatch with service_reloading, with no ledger or object write.
Optional
- Step 4 links
crates/dim-app-server/README.md#process-activity, which still documentshold()/release(id)(README.md:479). State that #2021's keep surface lands with its implementation or update the reference, so readers do not see two contracts.
Prior findings and peer status
No prior findings; the previous three reviews approved earlier heads. This blocker is new in the delta, and no peer review exists at this head.
CI
At 58903252: changes and macos-native passed; verify (linux) and ci-ok failed after this review was posted, with capabilities_flow failing permission_flow::worktrees::git_unavailability_timeout_reload_and_session_close_do_not_publish_permission (765 passed, 1 failed); scripts, static-checks, acp-registry, dependencies and web are skipped by their gates. The failure's relation to this docs diff is not established.
Conflicts
origin/main 6ee758ad: merge-tree clean.
Blocks inspected
The changed online task contract and test plan (Migration.md:176-184, :219-224), the #2021 keep decision, the #2454 shutdown paragraph, the process-activity admission implementation and README, and the merge tree.
Not verified
The docs checks (adr-check, whitespace diff) were not run locally; verify (linux) and ci-ok failed after this review was posted; the full #2454 issue thread was not re-read.
eric8810
left a comment
There was a problem hiding this comment.
APPROVE(设计)。上轮阻塞已解决:新版任务合同 由 Migration 的后台任务持有同一个 keep(work)。受理记录落盘后 RPC 才返回 ID,断开只结束观察;最后一次写入、清理和终态落盘后才释放接纳。新版验收分别钉住迁移先获接纳时升级答 daemon_busy、空闲关闭先暂停时回调无运行记录或对象写入,以及显式关闭先结算再拆业务所有者。回执丢失用原请求 ID 查找,不另起任务。
这里只批准设计修订。App Server 正常关闭协调点仍由该所有者确认,实现时再跑 CLI/Web 断连、两种接纳顺序和重连读回验收。作者报告 ADR/diff 检查通过;我未运行实现,核对时 GitHub CI 仍在运行。
|
Fixed in The acceptance cases now exercise refusal at dispatch with no ledger or object write, and |
There was a problem hiding this comment.
APPROVE
Round 5 review of 60ddbdc5eb1a7e849a25aa0d52a0ed1d75356a10 against origin/main 6ee758ad61b4ba13f2972fe8cae19eef26efaaab. The delta 58903252..60ddbdc5 is one docs commit, 4 insertions and 4 deletions in docs/design/plugins/Migration.md. It resolves the round-4 paused-path blocker; peer review 6208203342 is APPROVED at this head, referenced, not repeated.
Design
No blocking finding. The new admission narrative matches the code: dispatch takes process admission before the handler and holds it through the acceptance reply (crates/dim-app-server/src/connection.rs:438-447, :508-511, :549-561); idle shutdown pauses admission only at count zero (crates/dim-app-server/src/control.rs:99-103); a paused admission fails the dispatch hold (connection.rs:444-445), so the request never reaches Migration. Step 2 now states that the RPC's dispatch-time admission is still held when the background task acquires its own keep admission, which closes the round-4 gap.
Structure
No blocking finding. Step 3 retains keep's admission through terminal settlement; step 5 settles explicit shutdown inside work before the coordinator proceeds; step 4's daemon_busy matches the activity hold. The test plan covers the busy case, the dispatch-level refusal, the lost acceptance reply, and explicit-shutdown ordering.
Resolved and withdrawn
- The round-4 blocker is resolved: step 2 no longer claims keep returns
pausedin this flow, and the acceptance case now expects dispatch-levelservice_reloadingwith no Migration handler, norunningrecord and no object write (docs/design/plugins/Migration.md:181,:223). - The prior Optional is resolved: step 4 now links
README.md#shutdown-completion(crates/dim-app-server/README.md:467), which states the idle-shutdown contract; the keep surface remains a recorded dependency of this proposal.
CI
At 60ddbdc5: changes, macos-native, verify (linux) and ci-ok passed; scripts, static-checks, acp-registry, dependencies and web are skipped by their gates.
Conflicts
origin/main 6ee758ad: merge-tree clean.
Blocks inspected
The changed admission text and acceptance cases (Migration.md:176-184, :219-224), the #2021 keep decision, the #2454 shutdown paragraph, the dispatch and admission paths in connection.rs and control.rs, the README shutdown-completion section, and the merge tree.
Not verified
No docs checks (adr-check, whitespace diff) ran locally; ci-ok passed after this review was posted; the full #2454 issue thread was not re-read.
There was a problem hiding this comment.
APPROVE
Round 6 review of a86148a7c6e0839aec9c35cbfafe13dc04c3ab0c, the merge of origin/main db3d816c into the PR branch, at base db3d816c72ae3174d75956ac4f45607a4cd07c0f. The merge changes no PR text: the 10 docs files still add +200/-20, and the old and new added/removed lines are identical. No new blocker.
Merge and design check
- The merge brings #2561 and #2611 into the base; it leaves the PR patch byte-identical and no conflict markers remain. The affected sections still agree with current main:
management-methods.md:128-138saysorigin.entryis unimplemented, matchingsession-boundary.md:231,641; the web allowlist, CLI migration, provider, settings, Scheduler and owner-operation additions keep their referenced anchors. - The prior round-4 Design blocker (process admission held through dispatch; idle pause only at count zero) remains resolved. The one existing thread (comment 4764925134) is addressed by the new daemon-behavior text at
docs/design/cli-commands.md:2820; a reply records the fix and the thread stays open in the UI.
CI and conflicts
At a86148a7: changes, macos-native, verify (linux) and ci-ok passed; scripts, static-checks and windows-cli were skipped for this docs-only change. Merge-tree against origin/main is clean; no conflicts with #2399 or #2606; #2489 and #2493 overlay conflicts remain in unrelated code files.
Blocks inspected
Full main...head at the new base, all 10 docs changes and referenced anchors, the merge resolution, existing threads, CI and merge trees.
Not verified
No local docs or code suite ran; CI passed after this review was prepared. The head may move.
eric8810
left a comment
There was a problem hiding this comment.
批准 a86148a7 的设计复审。同步主线没有改变先前批准的迁移合同:RPC 持有接纳到受理落盘,Migration 的后台接纳覆盖到终态;空闲关闭抢先则在分派层拒绝,不写账本。显式关闭协调点仍待 App Server 所有者确认,CLI/Web 断线与回执验收留给实现。
核对了同步后的文档增量和相邻合同。同提交 CI 复跑后 Linux、macOS 原生及总门禁通过;首次 macOS OCR 大结果测试超时,不把复跑通过当成其根因已修复。未运行迁移实现;本批准不代替合并门槛。
Simon-He95
left a comment
There was a problem hiding this comment.
Reviewed a86148a7c6e0839aec9c35cbfafe13dc04c3ab0c (docs(design): define the v2 online migration task, commit and recovery contract, refs #2454). 10 files, +200 −20.
Scope: The two PR-own commits since the bot's last review at f365d800: 589032523 (keep process admission through task settlement) and 60ddbdc5e (place idle shutdown refusal at RPC dispatch), plus the merge a86148a7 that only moves the base to origin/main; the PR text remains 10 docs files +200/−20. I did not re-review 72c4b446..f365d800.
Direction: The new commits close the peer's admission gap rather than papering over it. App Server now takes process admission at dispatch before migration.start/migration.retry, holds it through the acceptance reply; Migration's background task takes keep(work) while that admission is still held, and the callback keeps it to terminal state. Idle shutdown can only pause at zero admission, so the refusal moves to dispatch (service_reloading) and never enters Migration. That is the minimal mechanism: it reuses processActivity and managementMethods, adds no second task ledger, and leaves target-owner receipts where they already belong. The explicit-shutdown coordination point stays a proposal for the App Server owner, which is the right boundary.
Architecture: Migration owns tasks; App Server owns process admission and shutdown; each target owner commits its data and receipt. The text now states the two-layer admission explicitly (dispatch admission + background work admission), so there is no zero-count window between the reply and settlement. The keep(work) contract is cited from #2021 comment 7442146346; the link anchor ../../../crates/dim-app-server/README.md#shutdown-completion exists. The explicit-shutdown order is stated consistently in §2 and §5: Migration stops accepting, settles within the same work, then business owners deactivate; the coordinator waits. The acceptance list was updated for both the daemon_busy upgrade path and the paused-at-dispatch path, and the obsolete keep returns paused formulation was removed.
App Server surface: The PR changes the design of migration.* management methods and the process-admission/shutdown contract, but no app-server, protocol or generated file changes.
App Server surface
Changed: no method/parameter/reply change. The proposal adds the processActivity.keep(work) operation and an explicit-shutdown coordination point for the App Server owner; migration.start/retry are dispatched under a process admission that is held through the acceptance reply.
Consumers: CLI and local Web migration.*; the offline migration run/retry path that must move to the same online entry; the App Server's idle/normal shutdown paths.
Classification: not breaking for current clients (docs only); additive to the process owner. The proposal still needs owner confirmation, as the document states.
Required: App Server owner acceptance of keep(work) and the shutdown coordination point; the implementation PR must preserve the documented flags, JSON and exit codes and add the script-compatibility and daemon_busy fixtures.
Prior findings
f365d800clarification 1 (mixedmigration.list/reportshapes between local socket and Web): not addressed by these two commits; unchanged, non-blocking.f365d800clarification 2 (receipt owner/atomic write/delete matrix): not addressed; unchanged, non-blocking.f365d800clarification 3 (Web display/path boundary fornotice/status): not addressed; unchanged, non-blocking.f365d800item 4 (script compatibility +daemon_busy): the new acceptance bullet coversdaemon_busyand the paused-at-dispatch path; script compatibility remains as stated.- The peer blocker at
f365d800(process admission must cover the background task, not just the start/retry RPC) is resolved by589032523;60ddbdc5ecorrectly moves the refusal to dispatch and fixes the anchor to#shutdown-completion.
Verified
- Read the two commit diffs:
f365d800..589032523(9/+7,Migration.md) and589032523..60ddbdc5e(4/+4,Migration.md); confirmed the mergea86148a7keeps the PR text at 10 docs files +200/−20. - Checked #2021 comment
7442146346exists and describes thekeep(work)correction. - Checked
crates/dim-app-server/README.mdhas### Shutdown completion; checked #2454 is an accepted P2 issue. gh pr checks 2455:changes,ci-ok,macos-nativeandverify (linux)passed;static-checks,scripts,web,windows-cli,acp-registryanddependenciesskipped (docs-only).
Not verified
- Did not re-review
72c4b446..f365d800; only the two new commits and the merge delta. - Did not verify the proposed
keep(work)/dispatch-admission API exists incrates/dim-app-server; it is explicitly a proposal. The currentServerControl/ProcessActivitydoes not expose it. - Did not verify the eventual App Server shutdown ordering against the coordinator implementation; the PR marks it
待 App Server 所有者确认. - No runtime or script fixtures run (docs-only).
Verdict: APPROVE — the two commits resolve the background-task admission gap coherently and keep the owner boundary; the remaining items are unchanged implementation-stage clarifications.
Summary
Refs #2454
设计覆盖 CN 和 Global 用户升级后的首次迁移提醒。用户可以先继续聊天,再从 CLI 或本机 Web 把旧数据导入正在运行的 daemon。本 PR 提请评审在线迁移合同。定稿后分两次交付实现,先接入所有者与既有命令,再接入 CLI/Web 首页和进度。当前产品仍使用离线导入。
sqliteStorage独占.sqlite.lock和写连接。Migration 通过目标所有者提交。start/retry前取得进程接纳。若空闲关闭先暂停接纳,请求在进入 Migration 前即被拒绝。已分派的 RPC 等待受理落盘,期间 Migration 后台任务通过processActivity.keep(work)取得自己的接纳并保持到终态。CLI 升级请求空闲关闭时,活动迁移使 daemon 返回daemon_busy,任务继续。拟议的显式正常关闭协调点等待 Migration 在 Provider 停用前结算已接单对象并持久化interrupted,已受理的用户停止结算为cancelled。CLI/Web 收到关停错误或断线后等待重连,用原任务 ID 查终态。强制终止后凭租约和回执恢复。FULL事务一次发布并写回执。建议前台持久化写入的 p95 较基线增加不超过 200 ms,任一写入额外延迟小于 1 s。两组总量相差 4 倍且单条记录大小相同的 fixture,迁移新增峰值 RSS 相差不超过 64 MiB。v2。CLI 和本机 Web 对同一目标使用同一配对,浏览器只能选择宿主识别的来源及其任务。维护者的渠道决定请维护者重点确认三个合同。
origin.entry;Migration 用它过滤任务列表和按 ID 的操作。本机 socket 可见当前目标的全部任务,Web 只可见宿主识别的配对。管理方法TaskState。报告第一页同时固定任务头和结果,保留脚本的format: 1、sourceHome、current和空值语义。CLI 报告协议实现阶段用隔离 fixture 核对会话发布、配置条件写入、账号恢复、脚本兼容、前台延迟及内存预算。对象所有者操作 · 验收条件
Design rule checklist
before— 不适用,导入不注册before。入口检查传输权限与形状,所有者验证候选对象。processActivity、managementMethods和现有存储职责。Documentation
Verification
node scripts/adr-check.mjs --base origin/main通过,覆盖 10 个变更文档。git diff --check origin/main...HEAD通过。TaskState的 10 个字段、脚本格式值及传输层的关停错误。