Repository navigation
Conversation
|
评审(head
|
|
已按评审修改,head
|
|
已按 A–G 自查修改,head
|
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: part of the owner-contract documentation series under design rules §7 (refs #2022 and #2015), covering the MCP, Hooks, Skills and PluginManager owners.
Verdict: REQUEST_CHANGES
P1: none.
P2-1. The MCP target rewrites client-visible operations while claiming that nothing changes.
Problem: the operation table changes shapes that current clients use. mcp.catalog replies {entries, invalid, application} instead of the current {servers, userRevision, projectRevision, userApplication, pluginApplication, projectApplication, invalid} (crates/dim-app-server/src/mcp/management.rs:459). mcp.inspect becomes a process-wide {} read returning {sessions} instead of {cwd?, id, source} returning {enabled, configuration, connections} (management.rs:52,703; docs/design/appserver/mcp-management.md §6 says inspect keeps its request and reply). mcpSession.state replies {servers, error?} instead of {servers, catalogError, closed} (crates/dim-app-server/src/mcp/session.rs:102). session.mcp_temporary.attach becomes {server} to {binding, tools} instead of {sessionId, bindingId, servers} to {} (crates/dim-app-server/src/mcp/temporary.rs:52,328; docs/design/plugins/TemporaryMcp.md:40). The table also drops mcp.import.sources (management.rs:1090, docs/design/appserver/mcp-management.md:660) and mcp.temporary.capabilities (management.rs:861, used by crates/dim-acp/src/mcp.rs:104), both advertised today.
Failure scenario: the CLI import discovery, the Web and Desktop MCP panels, and the ACP temporary binding path lose fields, methods or error codes they match, while the Client-visible changes section says no field name, error code or notification changes.
Fix: keep the current requests, replies and codes and re-source mcp.inspect from the report registry, or list each shape change in Client-visible changes and update mcp-management.md, mcp-apps.md, TemporaryMcp.md, the CLI, the Web client and ACP in the same change.
P2-2. The Skills target contradicts the installation design it keeps and itself.
Problem: skillsCatalog.register is defined as {plugin, dir, document} and the appendix types the document as SkillDocument, but a plugin's skills manifest member is a directory (PluginManager.md §2.1), the current face registers a root (crates/dim-agent-capabilities/src/skills/face.rs:18-26), and SkillDocument is the catalog's own installation record (crates/dim-app-server/src/skills_management.rs:43). skills.preview and skills.install change to a token flow {source, selection} and {token, selection}, while the retained §2.3 (lines 252-256) still shows {source, id, skills, overwrite} and the current method is InstallParams {source, id?, skills, overwrite} (skills_management.rs:328-344,798-825).
Failure scenario: an implementer cannot satisfy both install requests, and a plugin can pass the catalog's installation record as its own document. The same document defines two incompatible preview replies ({token, entries, invalid} versus {source, skills, conflicts, shadows, issues}).
Fix: make the register request {plugin, dir}; choose one preview and install shape and update §2.3 with it; or declare the token flow as a client-visible change and rewrite the retained installation section.
P2-3. The PluginManager target contradicts its own §7, its current wire and the behavior it says it keeps.
Problem: the operation tables omit invalid_id and path_outside_plugins, which §7 (line 343) says a failed path check returns, and plugin_locked, which plugin.enable and plugin.disable return today (crates/dim-app-server/src/plugin_manager.rs:1459-1464,1505-1509). The replies are documented as {packages} and {package, progress?}, but plugin.list returns a bare array (plugin_manager.rs:2151) and install/enable return the status map with id, name, enabled, locked, skipped, refused and restartRequired (plugin_manager.rs:636-651,1355-1366). The error vocabulary moves from plugin_not_found, plugin_exists, plugin_locked and invalid_params to missing, exists, load_failed and others. The Supersedes line deletes §3 to §5 and §9, but the target says install/update/remove behavior stays; the detailed behavior and its R1/R2/R4/R5 requirements are not restated, and other documents still cite them.
Failure scenario: path checks and locked plugins lose their public refusals, clients and the model tool lose fields and codes, and the install, update and remove behavior cited by LightOcr.md:179 and RuntimeManager.md:83 has no normative description left.
Fix: add the missing codes and keep or declare the reply shapes and error codes, and either keep the behavior section or move it into the target with the requirements.
P2-4. The Hooks target changes client-visible management shapes and contradicts its own reader decision.
Problem: hooks.catalog is documented as {project?} to {sources, entries}, but it currently takes {cwd?} and returns {userRevision, userDocument, projectsRevision, disableAllHooks, sources, hooks} (crates/dim-app-server/src/hooks_settings.rs:334-352,721). hooks.save takes expectedRevision, and hooks.set_enabled takes cwd and expectedRevision (hooks_settings.rs:376-386), not revision and project. The error kinds invalid_document, settings_write and settings_conflict replace hooks_invalid, hooks_conflict and hooks_failed (hooks_settings.rs:388-397). Separately, line 17 says the management methods and the agent-crate port use the same reader, while the same document deletes SettingsHookSources (line 104), merges the two readers (line 160) and replaces the HookSourcesHost port (line 213).
Failure scenario: the /hooks panel and dimcode hooks cannot match the fields or refusals, and an implementer cannot tell whether a Session or branch source port survives.
Fix: keep the current fields and codes or declare the change and update cli-commands.md and the clients; remove the agent-crate-port clause and state that the data face is the only reader.
P2-5. The deletions leave internal and external references dangling, and the newly added links are partly broken.
Problem: this PR deletes Hooks §10, Appendix H, A.2.1, A.6 and A.7, and PluginManager §0, §1, §3 to §5, §8, §9 and the Appendix, but the retained text still points at them. Examples: Hooks.md:3 (§10), Hooks.md:208 (Appendix H), Hooks.md:302 (decision 8), Hooks.md:346 (A8), PluginManager.md:3 (§0), PluginManager.md:201,269,319 (§3.2), PluginManager.md:213,346 (§9 R1, R5), PluginManager.md:350 (Skills §4), Skills.md:329 (Hooks.md#a62-submit-check-at-the-operator-input-entries), Skills.md:417 (Hooks §3.3) and contracts/session-boundary.md:281 (Hooks A.7). A scripted scan also finds about 45 links in 22 documents that resolved before this PR and now point at deleted headings, including docs/design/overview.md, docs/design/cli-commands.md, docs/design/plugin-distribution.md, docs/design/plugins/LightOcr.md, docs/design/appserver/settings-service.md and architecture pages. In addition, the new links plugins/PluginManager.md#target-contract at contracts/resource-owner-operations.md:14,136 and contracts/session-boundary.md:546, and plugins/Mcp.md#target-contract at contracts/resource-owner-operations.md:140 and service-faces.md:158,382, resolve to missing paths or a missing anchor, because Mcp.md has no ## Target contract heading. The row at resource-owner-operations.md:139 still names HookSources and HookSourcesSnapshot even though the Hooks target deletes that port and makes hooksService.sources the only reader.
Failure scenario: contract cross-references, the documents' own pointers and the new target links land nowhere after merge, and readers of the Settings matrix still see the deleted port.
Fix: add the Mcp heading, use ../plugins/... from the contracts directory, retarget the 45 inbound links and the internal references to the new target sections (or keep stub anchors), and update the HookSources row in this change.
P2-6. The MCP sections this PR says it replaces are still the authoritative text.
Problem: Mcp.md §Supersedes replaces the public-surface sections of mcp-management.md §8, mcp-apps.md §4.4, mcp-oauth.md and TemporaryMcp.md, but those sections are unchanged and still describe the old faces: mcpService.register replies null and refusal is a [message, reason] tuple (mcp-management.md:1363-1408), mcpSession.state has catalogError and closed and subscribe stays Rust-only (mcp-apps.md:412-436), and session.mcp_temporary.attach takes sessionId, bindingId and servers (TemporaryMcp.md:40-42). The old error codes (mcp_invalid_config, mcp_settings_read, service_reloading, operation_interrupted) remain the stated contract there.
Failure scenario: two authoritative contracts describe the same face and disagree, so an implementer or reviewer can follow the old one, and the old public surface survives after the target removal.
Fix: update those sections in this PR or mark them superseded with a pointer to Mcp.md, and remove the old operation descriptions in the same change that migrates the callers.
P3-1. The binding appendices describe types and wire behavior that do not hold.
Problem: the four appendices claim that the named error types are #[serde(rename_all = "snake_case")] enums serialized as {code, data} with the message in data, and that From<CallError> keeps the callback's code and message. The current rutis binding throws {name, code, message, data} with message from Display; a non-serializable error uses its Debug variant as the code. McpAppError is a non-serializable thiserror enum (crates/dim-app-server/src/mcp/session.rs:146), so it would throw Absent, Unsupported and so on, not the documented lower-case codes. PluginError is a struct (plugin_manager.rs:43-50). McpDocument, McpRefusal, McpView, McpContentError, McpSessionError, McpTemporaryError, HooksRefusal, HookSources, HookSourceError, SkillIssues, SkillContentError and SkillListError do not exist; McpPluginDocument, McpPluginRefusal, McpWidgetResult, HookRefusal, HookSourcesSnapshot, SkillIssue and SkillsError are the current names, and SkillDocument is pub(crate). PublishedTool is private and not Serialize.
Failure scenario: the appendices cannot be implemented against the named modules, and an implementation that follows the documented serde shape changes client-visible codes.
Fix: name the current types or mark the new names, derives and tags as target, describe the real wire object, and name the From<rutis::host::CallError> impl when a callback failure must propagate.
P3-2. Forward references are not attributed to their owning PRs.
Problem: line_owner::<T>(line) in Hooks.md:178 and Skills.md:205 is defined by the SessionScope contract in PR #2093, not by ADR 027, which defines id-based dispatch but no helper name. The §7 rules are in PR #2029; Settings operations are in #2094; FileStorage is in #2080; SessionScope is in #2093; ManagementMethods is in #2095; the registries and Prompt are in #2100, #2102 and #2103. The documents list these as dependencies, but a reader on main cannot resolve the names.
Failure scenario: implementers cannot find the contracts for the operations the target tables call, and a reviewer cannot tell a target name from a current one.
Fix: link each borrowed name to its owning PR or issue, and mark line_owner and the registry and Settings operations as target operations pending those PRs.
P3-3. Small leftover text conflicts and gaps.
Problem: Hooks.md:141 says Permission.advise and Approval.decide are "#2028's contract names", but #2028 is a scan issue and the contract lives in #2100. Skills.md:208-210 keeps the old Scope: process. Issue: #740 header under the target section, while the target says process, Session and branch with issue #2022. PluginManager.md:3 says the scope is process (installation per host), while the target adds a Session tool part, and it still names the deleted §0. The Hooks Errors table omits deny, ask, allow, warnings and proceed, which its operation table lists under Errors.
Failure scenario: scope and ownership are ambiguous, and an implementer cannot map every listed result to the error contract.
Fix: cite #2100 for the Permission and Approval names, remove or rewrite the old headers, and add the missing result kinds to the Errors table or move them out of the Errors column.
Cross-PR note: open PRs #2080, #2093, #2094, #2095, #2100, #2102 and #2103 edit docs/design/plugins/README.md and docs/design/service-faces.md, and several edit docs/design/contracts/resource-owner-operations.md and docs/design/contracts/session-boundary.md. This PR adds rows and links in the same places, so the rebases will conflict textually. Coordinate the merge order and the anchor targets with those PRs.
Checks: node scripts/adr-check.mjs --base 5a279d6988c80692a77f3438fff4d26f7875e4c9 passes. CI reports ci-ok and changes passing; the remaining jobs are skipped for this documentation-only diff. No broad test suite was run.
| @@ -0,0 +1,243 @@ | |||
| # Mcp | |||
|
|
|||
| Scope: process and Session. Issue: #2022. | |||
There was a problem hiding this comment.
Problem: this file has no ## Target contract heading (it goes from # Mcp to ## Supersedes), but the PR adds links to Mcp.md#target-contract at docs/design/service-faces.md:158, docs/design/service-faces.md:382 and docs/design/contracts/resource-owner-operations.md:140; those anchors resolve nowhere.
Failure: the two MCP rows in service faces and the caller row in the resource matrix cannot reach the owner contract they name.
Fix: add ## Target contract above this line, as the other three owner documents do, or point the links at #use-and-scope-responsibility-split.
There was a problem hiding this comment.
Fixed in 964c6b5. Mcp.md:9 now has ## Target contract, and the links at docs/design/service-faces.md:158,382 and docs/design/contracts/resource-owner-operations.md:14,136,139,140 resolve to it.
| - **Configuration documents.** The Settings sources `mcp`, `mcp-projects`, `mcp-plugins` and `mcp-secrets`; `.mcp.json` is the project file of `mcp-projects` under a project Settings authorizes. | ||
| - **Content registration.** The MCP document a plugin package carries, the holding plugin, and the refusal reason. | ||
| - **Connection definitions and credentials.** The resolved server definitions, the OAuth records and refresh, and the disposable probe connection. | ||
| - **Client operations.** `mcp.catalog`, `mcp.configuration`, `mcp.update`, `mcp.save`, `mcp.remove`, `mcp.set_enabled`, `mcp.move`, `mcp.import.preview`, `mcp.import.apply`, `mcp.test`, `mcp.inspect`, `mcp.disconnect` and `mcp.auth.*`. |
There was a problem hiding this comment.
Problem: the client operation list omits two public methods that exist and are advertised: mcp.import.sources (crates/dim-app-server/src/mcp/management.rs:1090, crates/dim-app-server/src/protocol.rs:290, docs/design/appserver/mcp-management.md:660) and mcp.temporary.capabilities (management.rs:861, protocol.rs:285, docs/design/plugins/TemporaryMcp.md:30, used by crates/dim-acp/src/mcp.rs:104).
Failure: an implementation following this table loses the CLI import discovery path and the ACP temporary binding check, and the target contract never says where those methods go.
Fix: add both rows, or name the owner that takes them and link its contract.
There was a problem hiding this comment.
Partially fixed in 964c6b5. mcp.import.sources and mcp.temporary.capabilities now have rows at Mcp.md:127-128, but the client-operation bullet at Mcp.md:20 still omits both. The new capabilities row is also wrong: the current reply is {transports, leaseSeconds} (crates/dim-app-server/src/mcp/management.rs:861-865), not {capabilities}.
| | `mcp.import.preview` | Parse an import payload without writing | `{document, project?}` | `{entries, invalid}` | Read can be cancelled | `invalid`, `closed`, `cancelled` | | ||
| | `mcp.import.apply` | Write the selected imported entries | `{document, selection, project?}` | `{applied, invalid}` | Accepted write is not cancelled | `invalid`, `conflict`, `closed` | | ||
| | `mcp.test` | Probe one server definition with a disposable connection | `{config, timeout?}` | `{status, latency, tools, reason}` | Cancel or timeout stops the probe; the owner settles it | `invalid`, `timeout`, `refused`, `cancelled`, `closed` | | ||
| | `mcp.inspect` | The connection states reported by Sessions | `{}` | `{sessions: [{sessionId, entries}]}` | None | `closed` | |
There was a problem hiding this comment.
Problem: the row changes mcp.inspect to a process-wide {} read returning {sessions: [{sessionId, entries}]}. The current method takes {cwd?, id, source} and returns {enabled, configuration, connections} (crates/dim-app-server/src/mcp/management.rs:52,703-725), and docs/design/appserver/mcp-management.md §6 says inspect keeps its request and reply. There is no current sessions field.
Failure: the CLI, Web and Desktop clients that read inspect break, and the Client-visible changes claim that the sessions field stays the same is false.
Fix: keep the per-entry read and re-source it from the report registry, or declare the new request and reply and update mcp-management.md and the clients.
There was a problem hiding this comment.
Fixed in 964c6b5. Mcp.md:130 now reads {cwd?, id, source} to {enabled, configuration, connections}, matching crates/dim-app-server/src/mcp/management.rs:52-57,703-725.
|
|
||
| ## Client-visible changes | ||
|
|
||
| `mcp.inspect` returns the connection states reported by `McpSession` parts instead of reading `McpPublication`. The client field `sessions` and the per-entry shape stay the same; the change is where the value comes from, and the local MCP management client and the App Server `session.mcp` path need only refresh after the next report. `mcp.disconnect` publishes the same command and returns; `mcpSession.state/refresh/widget/call` keep their request and reply shapes. The removed `mcpSession.subscribe` is Rust-only and never crossed the client protocol. No client error code, field name or notification changes. |
There was a problem hiding this comment.
Problem: this paragraph does not hold against the table above. mcp.catalog renames servers, the source revisions and the application records to {entries, invalid, application} (current McpCatalogResult, crates/dim-app-server/src/mcp/management.rs:459); mcpSession.state changes {servers, catalogError?, closed} to {servers, error?} (crates/dim-app-server/src/mcp/session.rs:102); session.mcp_temporary.attach changes request and reply (crates/dim-app-server/src/mcp/temporary.rs:52,328; docs/design/plugins/TemporaryMcp.md:40); and the appendix says the wire code is the variant name, which renames the current mcp_* codes.
Failure: clients and tests that match field names or error codes fail, while this section tells reviewers no such change exists.
Fix: keep the current shapes and codes, or list each change here and update mcp-management.md, mcp-apps.md, TemporaryMcp.md and the client paths.
There was a problem hiding this comment.
Partially fixed in 964c6b5. The mcp.catalog reply, mcpSession.state ({servers, catalogError, closed}, crates/dim-app-server/src/mcp/session.rs:102) and session.mcp_temporary.attach request/reply (crates/dim-app-server/src/mcp/temporary.rs:52,328) now match the current wire. Remaining: mcp.catalog still takes {cwd?} (crates/dim-app-server/src/methods.rs:23-26), not {project?}; attach still says mount_failed where temporary.rs:73-91 uses mcp_binding_failed; and the other write methods still rename their request and reply fields while Mcp.md:178 says None. See the new body P2-1.
| } | ||
| ``` | ||
|
|
||
| `session.mcp_temporary.attach/renew/detach` are `SessionMethods` registrations; `attach` takes `caller: &Ctx` and the binding id is bound to the caller's Session row. `McpDocument`, `McpRefusal`, `PublishedTool`, `McpView`, `McpSessionState` and the request/reply structures are the types in `mcp/management.rs`, `mcp/session.rs` and `mcp/temporary.rs`; `McpContentError`, `McpSessionError`, `McpAppError` and `McpTemporaryError` are `#[serde(rename_all = "snake_case")]` enums serialized as `{code, data}` with `message` in `data`; the wire `code` is the variant name and matches the error tables. `From<CallError>` keeps the callback's own `code` and `message`. `CancelledFn` is the binding's cancellation argument, never a request field. |
There was a problem hiding this comment.
Problem: several names here do not exist in the named modules: McpDocument, McpRefusal, McpView, McpContentError, McpSessionError and McpTemporaryError (the current names are McpPluginDocument, McpPluginRefusal, McpWidgetResult, McpError and McpAppError), and PublishedTool is private and not Serialize. Under the current rutis binding a thrown value is {name, code, message, data} with message from Display, and a non-serializable error uses its Debug variant as the code. McpAppError is a non-serializable thiserror enum (crates/dim-app-server/src/mcp/session.rs:146), so it throws Absent and Unsupported, not the documented lower-case codes with the message in data.
Failure: the appendix cannot be implemented against the referenced modules and promises a wire shape the named types cannot produce.
Fix: name the current types or mark the new names, derives and tag as target, describe the real wire object, and name the From<rutis::host::CallError> impl. The same paragraph at Hooks.md:191, Skills.md:203 and PluginManager.md:167 has the same problem.
There was a problem hiding this comment.
Partially fixed in 964c6b5. Mcp now names McpPluginDocument, McpPluginRefusal and McpWidgetResult, and PluginManager now describes the PluginError struct and the target enum. Remaining: Hooks.md:195 calls HooksContentError and HookSourceError current, but neither exists on origin/main; Skills.md:207 still says errors serialize as {code, data} with the message in data; and Mcp.md:233 uses the private PublishedTool while line 238 promises PublishedToolRef. See the new body P3-1.
| | `hooksService.plugins` | The packages holding hook content | `{}` | `{plugins}` | None | `closed` | | ||
| | `hooksService.refusal` | The refusal of a package | `{plugin}` | `{reason?}` | None | `closed` | | ||
| | `hooksService.sources` | The merged hook sources for a cwd | `{cwd}` | `{sources, project?}` | The read can be cancelled | `unreadable`, `closed`, `cancelled` | | ||
| | `hooks.catalog` | The client's hook catalog | `{project?}` | `{sources, entries}` | The read can be cancelled | `invalid`, `closed`, `cancelled` | |
There was a problem hiding this comment.
Problem: the row describes hooks.catalog as {project?} to {sources, entries}, but the current method takes {cwd?} and returns {userRevision, userDocument, projectsRevision, disableAllHooks, sources, hooks} (crates/dim-app-server/src/hooks_settings.rs:334-352,721). hooks.save takes expectedRevision, and hooks.set_enabled takes cwd and expectedRevision (hooks_settings.rs:376-386), not revision and project.
Failure: the /hooks panel and dimcode hooks break, and the Client-visible changes claim is false.
Fix: keep the current field names, or declare the rename and update cli-commands.md and the clients.
There was a problem hiding this comment.
Fixed in 964c6b5. hooks.catalog is {cwd?} to {userRevision, userDocument, projectsRevision, disableAllHooks, sources, hooks} (crates/dim-app-server/src/hooks_settings.rs:334-352,721-775), hooks.save takes expectedRevision and document (376-379,777-790), and hooks.set_enabled takes cwd, enabled and expectedRevision (382-386,792-833). The error codes are the current hooks_invalid, hooks_conflict and hooks_failed (388-395); e39c8d4 also adds them to the Errors table. One leftover outside this thread: hooks.set_enabled replies {revision}, not {}.
|
|
||
| ### Client-visible changes | ||
|
|
||
| None. `hooks.*` and the six hook points keep their client-visible behavior; `hooksService.sources` is a plugin-facing owner operation, `HookSourcesHost` was agent-crate-private, and `Permission.advise`/`Approval.decide` are #2028's contract names. |
There was a problem hiding this comment.
Problem: hooks.* do not keep their client-visible behavior. The request fields change as above, and the error kinds invalid_document, settings_write and settings_conflict replace the current hooks_invalid, hooks_conflict and hooks_failed (crates/dim-app-server/src/hooks_settings.rs:388-397).
Failure: the /hooks panel and CLI cannot match the refusals; the deleted A.2.1 text said the Settings owner codes were preserved.
Fix: keep the current codes, or declare the change and update the clients and the error table.
|
|
||
| ## Supersedes | ||
|
|
||
| Replaces the old Hooks.md Structure, Flows, Rule check, Requirements, Appendix A.2.1/A.6/A.7/H and Owner check (deleted); the `hooksService` rows in [service-faces.md](../service-faces.md); the Hooks rows in [resource-owner-operations.md](../contracts/resource-owner-operations.md), [runtime-owner-operations.md](../contracts/runtime-owner-operations.md) and [session-boundary.md](../contracts/session-boundary.md); the `HookSourcesHost` port and the two-reader design. Rules: [§7 所有者与操作](https://github.com/arcships/dim/pull/2029). Dependencies are defined by [FileStorage #2080](https://github.com/arcships/dim/pull/2080), [Settings #2094](https://github.com/arcships/dim/pull/2094), [SessionScope #2093](https://github.com/arcships/dim/pull/2093) and the branch contracts #2102/#2100; HostPlatform is pending #2032. |
There was a problem hiding this comment.
Problem: the PR deletes Hooks §10, Appendix H, A.2.1, A.6 and A.7, but the retained text still refers to them: §10 at line 3, Appendix H at line 208, decision 8 at line 302 and A8 at line 346. A scan also finds about 45 links in 22 documents that resolved before this PR and now point at deleted Hooks or PluginManager headings, including docs/design/overview.md, docs/design/cli-commands.md, docs/design/plugin-distribution.md, docs/design/plugins/LightOcr.md, docs/design/appserver/settings-service.md and docs/design/contracts/session-boundary.md:281.
Failure: the document's own pointers and the contract cross-references resolve to nothing after merge.
Fix: retarget the references to the new target sections or keep stub anchors, and update the affected documents in this change.
There was a problem hiding this comment.
Partially fixed in 964c6b5 and e39c8d4. The Hooks stubs restore §10, Appendix H, A.6.1-A.6.3, 3.3 and A.7, and the retained references now point at the target or a stub. Remaining: four documents still link to the deleted PluginManager §3.7 (docs/design/appserver/mcp-management.md:30,1359, docs/design/appserver/mcp-oauth.md:496, docs/design/appserver/native-storage-format.md:512, docs/architecture/rust-agent/plugins/Skills.md:77), and the stub list has no 3.7 anchor. See the new body P2-5.
| | `sessionStore` | Session repository, metadata, attachments, Timeline and worktree associations use store, store.readMetadata/setTitle, sessionFiles, timelineStore and store.associateWorktree respectively. Session construction binds the existing Session-scoped timelineStore. Path import and fileId reads use the [Session files contract](../appserver/session-files.md). | | ||
| | `pluginFiles` | Scheduler uses pluginFiles.open(). EventHub retains a caller-managed scope through settlement of admitted publishes across row restarts. Both use scope.withLock and lease.read/replace for the same atomic text update. Scope.list/remove and lease.readBytes/replaceBytes have their existing contracts. | | ||
| | `settingsService` | Declared sources use settings.register/read/update/projects. PluginManager uses the owner-write form for CAS edits and applies its existing writeOnly redaction. SettingsMethods retains the local client-write path. [Settings contract](../appserver/settings-service.md#42-service-settings-owner-path). | | ||
| | `settingsService` | Declared sources use settings.register/read/update/projects. PluginManager uses the owner-write form for CAS edits and applies its existing writeOnly redaction; its target contract is [PluginManager.md](plugins/PluginManager.md#target-contract). SettingsMethods retains the local client-write path. [Settings contract](../appserver/settings-service.md#42-service-settings-owner-path). | |
There was a problem hiding this comment.
Problem: from docs/design/contracts/, plugins/PluginManager.md resolves under docs/design/contracts/plugins/, which does not exist; lines 136 and 140 have the same path error, and line 140's plugins/Mcp.md#target-contract also misses the absent Mcp heading.
Failure: three contract links in this file land nowhere, and the Settings caller row cannot reach the PluginManager target.
Fix: use ../plugins/PluginManager.md#target-contract and ../plugins/Mcp.md#target-contract, and add the missing Mcp heading.
There was a problem hiding this comment.
Fixed in 964c6b5. The PluginManager paths now use ../plugins/PluginManager.md#target-contract, the MCP row uses ../plugins/Mcp.md#target-contract, and Mcp.md:9 supplies the heading.
| 5. A tool that a non-Rust plugin registers through `toolRegistry` is declared to the model and executed through ToolExecutor like a Rust tool; a Session without a mount list declares it with no configuration edit. A tool the Session's mount list names that no part has registered is omitted and reported in diagnostics, the Session still starts, and the tool is declared from the next request once a part registers it. | ||
| 6. Progress precedes the response; progress the connection cannot take is dropped without closing the connection or losing the response; `notify` reports `gone` after disconnect. | ||
| 7. With an enabled management provider that is Pending, `hello` succeeds and every other namespace works. Its names return `unknown_method` until it first registers; once its namespace is withdrawn they return `service_reloading` while its row starts or reloads and `service_unavailable` once the row is Failed or Unresolved; with a disabled row they return `unknown_method`. Once PluginManager provides `plugin.disable` (not implemented), it can turn the provider off unless its name is locked, as PluginManager's own is. Reloading a management provider neither reloads Rpc nor closes connections. | ||
| 7. With an enabled management provider that is Pending, `hello` succeeds and every other namespace works. Its names return `unknown_method` until it first registers; once its namespace is withdrawn they return `service_reloading` while its row starts or reloads and `service_unavailable` once the row is Failed or Unresolved; with a disabled row they return `unknown_method`. Once `plugin.disable` ([PluginManager contract](plugins/PluginManager.md#target-contract)) is used, it can turn the provider off unless its name is locked, as PluginManager's own is. Reloading a management provider neither reloads Rpc nor closes connections. |
There was a problem hiding this comment.
Problem: plugins/PluginManager.md#target-contract is relative to docs/design/contracts/, so it resolves to docs/design/contracts/plugins/PluginManager.md and does not exist. Separately, line 281 of this file still links to Hooks.md#a7-management-methods, which this PR deletes.
Failure: the new link and the existing session namespace paragraph both land nowhere.
Fix: use ../plugins/PluginManager.md#target-contract and point line 281 at the Hooks target contract.
There was a problem hiding this comment.
Fixed in 964c6b5. session-boundary.md:546 now uses ../plugins/PluginManager.md#target-contract, and line 281's Hooks.md#a7-management-methods resolves through the A.7 stub at Hooks.md:410-411.
|
已按评审与自查标准修改,head 评审处理:
自查额外修改:Supersedes/Client-visible、README By scope、service-faces/resource-owner-operations/session-boundary/SessionTitle 的本所有者段落、 客户端可见变更:无。冻结的 绑定编译:临时 crate 校验被工作区 rust-version 挡住( |
|
已修复两处,head
|
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: target contracts for the MCP, Hooks, Skills and PluginManager owners (refs #2022 and #2015). Round 2 reviews the full main...head at e39c8d4 (12 files, +889/-1162) against origin/main 6e86d48c, including the delta over 964c6b5.
Delta note: e39c8d4 adds current error codes to the four Errors tables, adds a Hooks 3.3 stub, and replaces the rust-version caveat with a passed check. It does not fix the P2s below; the code-vocabulary wording is softened where the new tables help.
Verdict: REQUEST_CHANGES. P1: none.
Round-1 status
Fixed in 964c6b5: 4666876937 (Mcp.md:9 now has ## Target contract, and the links from service-faces and resource-owner-operations resolve), 4666876962 (mcp.inspect is {cwd?, id, source} to {enabled, configuration, connections}, matching crates/dim-app-server/src/mcp/management.rs:52-57,703-725), 4666877020 (PluginManager.md:172 now describes the current PluginError struct and the target enum), 4666877099 (hooks.catalog, hooks.save and hooks.set_enabled requests and the catalog reply match crates/dim-app-server/src/hooks_settings.rs:334-352,376-386,721), 4666877109 (hooks_invalid, hooks_conflict, hooks_failed restored), 4666877138 (../plugins/... links resolve), 4666877149 (session-boundary.md:546 uses ../plugins/...; the A.7 stub resolves). The four superseded-surface banners in mcp-management, mcp-apps, mcp-oauth and TemporaryMcp close round-1 P2-6.
Partially fixed: 4666876948 (both rows added, but Mcp.md:20 still omits them and the capabilities reply is wrong), 4666876969 (catalog reply, state and attach request/reply restored; catalog request, attach codes and the other write methods remain), 4666876983 (Mcp and PluginManager text names current types; Hooks, Skills and the Mcp signature still do not), 4666876993 (install adds invalid_id/path_outside_plugins, all rows add plugin_locked, and e39c8d4 adds those codes to the Errors table; update and remove still omit the path codes and many current codes), 4666877005 (list is now a bare array; its item shape, the requests and the enable/disable/update replies are still wrong; e39c8d4 adds the plugin_* codes to the Errors table but not the wire shapes), 4666877034 (references retargeted and stubs added; §3.6, Skills §4, the four §3.7 links and the install flow remain), 4666877047 (register row fixed; the caller example and appendix still pass document), 4666877066 (preview/install rows restored; the example, Flows and Exceptions still use the token), 4666877072 (preview/install codes restored and e39c8d4 adds the current skills_* codes to the Errors table; update/remove codes and three install codes remain), 4666877084 (the Hooks A.6.2 link resolves, and e39c8d4 adds a Hooks 3.3 stub at Hooks.md:395; PluginManager.md:355 still names Skills §4), 4666877129 (stubs added; four inbound §3.7 links and the internal §3.6 references remain).
Still open: 4666877092 (the deleted agent-crate port is still asserted at Hooks.md:17,153,166,167).
P2 findings
P2-1. The MCP target still rewrites most client operations while Client-visible changes says None
Problem: Mcp.md:178 says no client-visible change, but most mcp.* rows use shapes that are not current. mcp.catalog takes {cwd?} (crates/dim-app-server/src/methods.rs:23-26), not {project?}. mcp.save takes {cwd?, id, source, expectedVersion, configuration} and returns {} (crates/dim-app-server/src/mcp/management.rs:76-86,933-1018), not {id?, revision?, entry} to {entry, revision}. mcp.update, mcp.set_enabled, mcp.move, mcp.import.preview, mcp.import.apply, mcp.test, mcp.disconnect and mcp.auth.* differ in the same way (management.rs:40-148,412-442,1176-1234). mcp.temporary.capabilities returns {transports, leaseSeconds} (management.rs:861-865), not {capabilities}. The attach row restores the request and reply but renames the current invalid_params and mcp_binding_failed (crates/dim-app-server/src/mcp/temporary.rs:73-91,234-268) to invalid and mount_failed.
Failure scenario: the Web MCP editor sends source, expectedVersion and configuration (web/src/features/settings/McpSettings.vue:376-378), and dimcode mcp sends the same (crates/dim-cli/src/management/mcp.rs:1090-1100,1153-1162). The current request structs deny unknown fields, so a daemon implemented from these rows refuses every edit, enable, move, test and sign-in as an invalid parameter. A client matching mcp_binding_failed also stops recognizing a temporary attach failure.
Evidence: the request and reply types are the management.rs structs above; the client payloads are at the cited Web and CLI lines; docs/design/appserver/mcp-management.md:1 repeats the false claim that the client methods keep their current requests, replies and error codes. e39c8d4 adds mcp_invalid_config, mcp_settings_read, service_reloading and operation_interrupted to the Errors table, but the operation requests and replies are unchanged.
Fix: restore the current request and reply names and codes in every row, or list each rename in Client-visible changes and update mcp-management.md, mcp-apps.md, TemporaryMcp.md, ACP, the CLI and the Web client in the same change.
P2-2. The PluginManager target still rewrites the plugin.* wire while Client-visible changes says None
Problem: PluginManager.md:124 says plugin.* keep their results and errors, but the table above changes them. plugin.list returns items {name, use, off, locked, candidates, optional?, update?} (crates/dim-app-server/src/plugin_manager.rs:2167-2199), not the status map in the row. plugin.install takes {source, id?, enable?} (plugin_manager.rs:1071-1077), plugin.enable takes {name, use?} (plugin_manager.rs:1095-1100), and plugin.update and plugin.remove take {id, ref?} (plugin_manager.rs:1102-1107), not the request fields in the rows. plugin.disable returns {} (plugin_manager.rs:1521-1523), and plugin.update returns {commit} or {version} plus optional content outcomes (plugin_manager.rs:1790-1795).
Failure scenario: current codes include not_updatable, not_removable, not_reloadable, name_changed, invalid_source, invalid_manifest, acquire_failed, optional_not_found, node_unavailable and dependencies_failed (crates/dim-app-server/src/plugin_manager/management.rs:15-43); load_failed, content_refused and restart_required are not current. The client plugin UI and dimcode plugin lose fields and refusals they match. e39c8d4 adds plugin_not_found, plugin_exists, plugin_locked, invalid_params, invalid_id and path_outside_plugins to the Errors table, but that table still keeps exists, missing, write_failed and usage, and the current codes listed above are still absent.
Evidence: the cited plugin_manager.rs request decoders, reply builders and the management.rs description table.
Fix: keep the current request fields, replies and codes and align the Errors table, or declare every change here and update the clients, the plugin tool description and docs/design/cli-commands.md.
P2-3. The Skills target contradicts its own table, caller example and retained install design
Problem: Skills.md:158 says no client-visible change, but the table and retained text disagree with the current wire and with each other. skills.preview takes {source, id?, cwd?} (crates/dim-app-server/src/skills_management.rs:328-334), not {source, skills}. skills.install returns {installation, previous?, version, issues} (skills_management.rs:426-433), not {installation, previous?}. skills.update takes {id} and returns the same install result (skills_management.rs:351-355,828-858), not {id, revision?} to {installed}. skills.remove replies {version} (skills_management.rs:309-312,860-864), not {}. The install and update rows omit skills_selection_invalid, skills_install_conflict and skills_install_failed (crates/dim-agent-capabilities/src/skills/mod.rs:358-361), and the update row's missing contradicts retained §2.4's skills_install_unknown (line 309). The caller example still passes a document to register and installs preview.token (Skills.md:55,62-63), and the Flows and Exceptions still describe the token (Skills.md:140,153).
Failure scenario: an implementer cannot satisfy both the example and the table, and clients following the table's update and remove replies lose version and issues; a client matching skills_install_unknown or skills_remove_failed stops recognizing the refusal. e39c8d4 adds skills_preview_stale, skills_install_exists, skills_install_unmanaged, skills_install_unknown and skills_write_failed to the Errors table, but the rows still omit the three install codes and still use missing, unmanaged, write_failed and delete_failed for update and remove.
Evidence: the cited skills_management.rs handlers and types, skills/mod.rs:346-361, and the retained §2.3 and §2.4 text at lines 251-311.
Fix: use the current shapes and codes, update the caller example, Flows and Exceptions, and drop the token from the appendix; or declare the token flow and every rename here and update §2.3, §2.4, the CLI and the Web client.
P2-4. Hooks still asserts an agent-crate port that the same document deletes
Problem: Hooks.md:17 says "the management methods and the agent-crate port use this same reader", while line 15 says hooksService.sources is the only reader and "there is no agent-crate port". Line 153 says the Session part reads "through the port", line 166 calls the port a host binding, and line 167 says the agent crate uses the port. The document deletes the SettingsHookSources duplicate (line 104), merges the two readers (line 164) and replaces HookSourcesHost (line 217).
Failure scenario: an implementer cannot tell whether a Session or branch source port survives. Keeping one contradicts the Supersedes section and the one-reader decision, and rebuilding it reintroduces the two-reader design this PR removes.
Evidence: docs/design/plugins/Hooks.md:15,17,104,153,164,166,167,217; origin/main still has HookSourcesHost at crates/dim-agent-capabilities/src/hooks/sources.rs:77.
Fix: state that HooksSettings and the management methods use hooksService.sources, and that HooksSession and HooksBranch read it through the process face. Delete the agent-crate-port clauses at lines 17, 153, 166 and 167.
P2-5. PluginManager deletions still leave the install flow and four contract links dangling
Problem: the retargeted "target install flow" at PluginManager.md:206,274,324 does not exist. The PR deletes §3.2 Install and §3.5 Update, and the target has only the one-line Flows row at line 108; the staging, dependency install, record CAS, rollback and re-acquisition steps are gone. Line 9 still says install/update/remove behavior stays as this document describes, and docs/design/plugins/LightOcr.md:179 and docs/design/plugins/RuntimeManager.md:83,150,171 rely on it. Separately, four links that resolved on origin/main now land nowhere because the stub list omits §3.7: docs/design/appserver/mcp-management.md:30,1359, mcp-oauth.md:496, native-storage-format.md:512 and docs/architecture/rust-agent/plugins/Skills.md:77 all use PluginManager.md#37-content-registration.
Failure scenario: PluginManager, LightOcr and RuntimeManager have no normative install or update flow left, and the cross-references from four documents fail after merge.
Evidence: origin/main docs/design/plugins/PluginManager.md:288 has ### 3.7 Content registration; HEAD keeps only the stubs at lines 357-389. HEAD PluginManager.md:324,326 also still point at deleted §3.6, and line 355 at Skills §4.
Fix: keep §3.2 and §3.5 or move their steps into a target install flow section; add ### 3.7 Content registration to the stub list; retarget §3.6 and Skills §4.
P3 findings
P3-1. Binding appendices still name non-current types and a wire shape the binding does not produce
Problem: Hooks.md:195 labels HooksContentError and HookSourceError as current, but neither exists on origin/main, and the text says the target uses the same names while the code block renames HookSourcesSnapshot to HookSources. Skills.md:207 still says SkillContentError and SkillListError are serde enums serialized as {code, data} with the message in data; the rutis binding throws {name, code, message, data} with message from Display and uses Debug as the code for a non-serializable error. SkillContentError, SkillListError and SkillIssues do not exist on origin/main, and the register signature still takes document: SkillDocument. Mcp.md:233 uses the private PublishedTool in the signature while line 238 says the target exposes a public PublishedToolRef.
Failure scenario: the appendices cannot be implemented as written, and the Skills appendix reintroduces the catalog's installation record as the plugin document.
Evidence: git grep over origin/main finds HookRefusal (crates/dim-app-server/src/hooks_settings.rs:413), HookSourcesSnapshot (crates/dim-agent-capabilities/src/hooks/sources.rs:61), McpPluginDocument and McpPluginRefusal (crates/dim-app-server/src/mcp.rs:453), McpWidgetResult (crates/dim-app-server/src/mcp/session.rs:112), SkillIssue (crates/dim-app-server/src/skills_management.rs:294) and SkillsError (crates/dim-agent-capabilities/src/skills/mod.rs:344), but no HooksContentError, HookSourceError, SkillContentError, SkillListError or SkillIssues.
Fix: name only current types as current, mark every new name and derive as target, describe the real wire object, and change the Skills signature to {plugin, dir} to SkillIssue[]/SkillsError.
P3-2. Small shape and text leftovers
Problem: hooks.set_enabled replies {revision} (crates/dim-app-server/src/hooks_settings.rs:818-833), not the {} in Hooks.md:97. Mcp.md:20 still omits mcp.import.sources and mcp.temporary.capabilities from the client-operation bullet. Mcp.md:7 leaves ## Supersedes empty and moves the "Replaces ..." paragraph under ## Target contract, unlike the other three owner documents. Skills.md:150 still names §6, which this PR deletes.
Failure scenario: a client that reads the hooks.set_enabled revision loses it, and readers of the responsibility list and the section pointers cannot find the named section.
Fix: use {revision} for hooks.set_enabled, add the two methods to the bullet, give Supersedes its paragraph, and retarget the plain-text section reference.
P3-3. Cross-PR forward references still cite scan issues in some places
Problem: the Supersedes paragraphs now link the owning PRs, but Requirements still cite #2026, #2027 and #2028 for names whose contracts are in #2103, #2100 and #2102. Hooks.md:182 still attributes line_owner::<T>(line) to ADR 027 alone, while the SessionScope contract (#2093) is the source of the operation.
Failure scenario: a reader on main cannot resolve the registry and Permission names to the PR that defines them.
Fix: keep issue references for tracking, but link the contract PR beside each forward name.
Cross-PR note
Target names agree with the rebased series where checked: FileStorage root_path/read/write/remove/list (#2080), SessionScope mount/unmount/config (#2093), Settings operations (#2094), ManagementMethods register (#2095), Permission advise and Approval decide (#2100), Prompt adoption configure (#2102), and ToolRegistry register with SessionMethods register (#2103).
The overlapping files need a merge order: #2100 edits docs/design/plugins/Hooks.md (and still carries the pre-target document), #2094 edits docs/design/plugins/PluginManager.md, #2080/#2091/#2094/#2096/#2098/#2099 edit docs/design/contracts/resource-owner-operations.md, #2095/#2097/#2100/#2102/#2103 edit docs/design/contracts/session-boundary.md, and nearly every series PR edits docs/design/service-faces.md and docs/design/plugins/README.md. The target names are consistent, but the textual merges will conflict and the second PR may reintroduce deleted sections or the old anchors.
Checks
LC_ALL=en_US.UTF-8 node scripts/adr-check.mjs --base 5a279d6988c80692a77f3438fff4d26f7875e4c9 passes on e39c8d4 ("ADR freeze passed: 12 changed files"). CI on e39c8d4: changes and ci-ok success; acp-registry, dependencies, macos-native, scripts, static-checks, web, windows-cli and verify are skipped for this documentation-only diff. I did not run the Rust test suite. The Desktop client is not in this repository, so its use of the changed MCP fields is inferred from the Web and CLI call sites, not directly checked.
|
|
||
| ## Client-visible changes | ||
|
|
||
| None. `mcp.inspect` keeps `{cwd?, id, source}` and `{enabled, configuration, connections}`, now re-sourced from the report registry; `mcp.catalog`, `mcpSession.state`, `session.mcp_temporary.attach`, `mcp.import.sources` and `mcp.temporary.capabilities` keep their current requests, replies and codes. The removed `mcpSession.subscribe` is Rust-only and never crossed the client protocol. |
There was a problem hiding this comment.
Problem: the heading claims no client-visible change, but most mcp.* rows still describe shapes that are not current. mcp.catalog takes {cwd?} (crates/dim-app-server/src/methods.rs:23-26), not {project?}. mcp.save takes {cwd?, id, source, expectedVersion, configuration} and returns {} (crates/dim-app-server/src/mcp/management.rs:76-86,933-1018), not {id?, revision?, entry} to {entry, revision}. mcp.update, mcp.set_enabled, mcp.move, mcp.import.preview, mcp.import.apply, mcp.test, mcp.disconnect and mcp.auth.* differ in the same way (management.rs:40-148,412-442,1176-1234).
Failure: the Web MCP editor sends source, expectedVersion and configuration (web/src/features/settings/McpSettings.vue:376-378), and the CLI sends the same (crates/dim-cli/src/management/mcp.rs:1090-1100,1153-1162). The current request structs deny unknown fields, so a daemon implemented from these rows refuses every edit, enable, move, test and sign-in as an invalid parameter.
Fix: restore the current request and reply names in every row, or list each rename here and update mcp-management.md, the CLI and the Web client in the same change.
There was a problem hiding this comment.
Partially fixed in eca395a. mcp.catalog is now {cwd?}, mcp.save is {cwd?, id, source, expectedVersion, configuration} to {}, mcp.import.sources and mcp.temporary.capabilities are in the operation list and table, and attach uses invalid_params, mcp_binding_failed, mcp_binding_conflict and mcp_binding_missing. Still open: mcp.configuration, mcp.update, mcp.remove, mcp.set_enabled, mcp.move, mcp.import.preview, mcp.import.apply, mcp.test, mcp.disconnect, mcp.auth.* and renew/detach still describe shapes or codes the code does not use, while the section still says None. The new inline comments and the body list the current signatures.
| | `mcp.import.preview` | Parse an import payload without writing | `{document, project?}` | `{entries, invalid}` | Read can be cancelled | `invalid`, `closed`, `cancelled` | | ||
| | `mcp.import.apply` | Write the selected imported entries | `{document, selection, project?}` | `{applied, invalid}` | Accepted write is not cancelled | `invalid`, `conflict`, `closed` | | ||
| | `mcp.import.sources` | Discover import sources | `{cwd?}` | `{sources}` | Read can be cancelled | `invalid`, `closed`, `cancelled` | | ||
| | `mcp.temporary.capabilities` | The temporary binding capabilities ACP reads | `{}` | `{capabilities}` | None | `closed` | |
There was a problem hiding this comment.
Problem: the reply is not {capabilities}. The current method returns {transports: ["stdio", "http", "sse"], leaseSeconds: 30} (crates/dim-app-server/src/mcp/management.rs:861-865), and TemporaryMcp.md:30 documents the same.
Failure: an implementation that follows this row changes the advertised document; the ACP gateway checks only that the method exists (crates/dim-acp/src/mcp.rs:104), so the field loss is silent until a client reads transports or the lease.
Fix: keep {transports, leaseSeconds}.
There was a problem hiding this comment.
Fixed in eca395a. mcp.temporary.capabilities now replies {transports, leaseSeconds} at Mcp.md:128, matching crates/dim-app-server/src/mcp/management.rs:861-865.
| | `mcpSession.refresh` | Ask the owner to rediscover the enabled entries | `{}` | `{}` | None; the signal is a value | `closed` | | ||
| | `mcpSession.widget` | The view for one published tool | `{publishedTool}` | `{view}` or absent | The client dropping the call cancels the read | `absent`, `unsupported`, `not_callable`, `unknown_server`, `unavailable`, `refused`, `unknown`, `closed` | | ||
| | `mcpSession.call` | One MCP Apps call | `{server, tool, args}` | `{result}` | The client dropping the call cancels the resource read | `unknown_server`, `unavailable`, `refused`, `unknown`, `cancelled`, `closed` | | ||
| | `session.mcp_temporary.attach` | Mount a client temporary binding | `{sessionId, bindingId, servers}` | `{}` | The caller dropping the call shuts the half-made binding | `invalid`, `mount_failed`, `cancelled`, `closed` | |
There was a problem hiding this comment.
Problem: the request and reply now match, but the error codes do not. Attach currently returns invalid_params for an invalid configuration and mcp_binding_failed for a setup or connection failure (crates/dim-app-server/src/mcp/temporary.rs:73-91,234-268); the row says invalid and mount_failed, and TemporaryMcp.md:44-50 states the current codes.
Failure: a client that matches mcp_binding_failed stops recognizing the refusal while the change is declared as none.
Fix: keep invalid_params, mcp_binding_failed, mcp_binding_conflict and mcp_binding_missing, or declare the renames and update TemporaryMcp.md and ACP.
There was a problem hiding this comment.
Fixed in eca395a. session.mcp_temporary.attach now lists invalid_params, mcp_binding_failed, mcp_binding_conflict and mcp_binding_missing at Mcp.md:140, matching crates/dim-app-server/src/mcp/temporary.rs:73-92,234-268. The adjacent renew and detach rows still use {binding} and the old codes; they are covered by a new inline comment.
|
|
||
| ### Client-visible changes | ||
|
|
||
| None. `plugin.*` and the `plugin` tool keep their commands, results and errors; the `Manager` handoff was a Session-part implementation detail. |
There was a problem hiding this comment.
Problem: the heading says plugin.* keep their results and errors, but the table above changes them. plugin.list returns items {name, use, off, locked, candidates, optional?, update?} (crates/dim-app-server/src/plugin_manager.rs:2167-2199), not the status map in the row. plugin.install takes {source, id?, enable?} (plugin_manager.rs:1071-1077), plugin.enable takes {name, use?} (plugin_manager.rs:1095-1100), and plugin.update and plugin.remove take {id, ref?} (plugin_manager.rs:1102-1107), not the request fields in the rows. plugin.disable returns {} (plugin_manager.rs:1521-1523), and plugin.update returns {commit} or {version} plus optional content outcomes (plugin_manager.rs:1790-1795).
Failure: current codes include not_updatable, not_removable, not_reloadable, name_changed, invalid_source, invalid_manifest, acquire_failed, optional_not_found, node_unavailable and dependencies_failed (crates/dim-app-server/src/plugin_manager/management.rs:15-43), while load_failed, content_refused and restart_required are not current. The client plugin UI and dimcode plugin lose fields and refusals they match. e39c8d4 adds the plugin_* codes to the Errors table, but it still keeps exists, missing, write_failed and usage, and the current codes above are still absent.
Fix: keep the current replies, request fields and codes and align the Errors table, or declare the changes here and update the clients, the tool description and docs/design/cli-commands.md.
There was a problem hiding this comment.
Partially fixed in eca395a. plugin.list now uses the item fields, install/enable/update/remove use the current request fields, and disable replies {}. Still open: plugin.list omits status, waitingFor, error and refused, the install/enable/reload replies are not the status map in the rows, remove rejects ref (crates/dim-app-server/src/plugin_manager.rs:1206-1213) but the row says {id, ref?}, and the Errors columns invent or omit codes. The new wire-code mapping line also does not agree with the Errors table.
| | `version` | — | The plugin's own version, three dot-separated numbers, each one or more digits. Optional, and required for an optional plugin (§2.3), where it names the install directory. | | ||
| | `code` | code | The rutis row fields ([rutis usage §2](../rutis-usage.md#2-plugins-are-rows-instances-mount-their-parts)) except `id` and `name`: `entry` is a path inside the directory; `inject`, `provides` and `instanceNames` are copied into the row; `config` is the row's configuration, with the host's patch for that plugin name deep-merged over it (below). | | ||
| | `dependencies` | code | The package manager whose dependencies the plugin declares. The only value today is `"npm"`: the directory carries `package.json` and `package-lock.json`, and the locked dependencies are installed into the plugin's own directory at acquisition (§3.2, §7). A manifest declaring it without either file is refused `invalid_manifest`. | | ||
| | `dependencies` | code | The package manager whose dependencies the plugin declares. The only value today is `"npm"`: the directory carries `package.json` and `package-lock.json`, and the locked dependencies are installed into the plugin's own directory at acquisition (§7 and the target install flow). A manifest declaring it without either file is refused `invalid_manifest`. | |
There was a problem hiding this comment.
Problem: the retarget points at a target install flow that does not exist. The PR deletes §3.2 Install and §3.5 Update, and the target has only the one-line Flows row at line 108; the staging, dependency install, record CAS and rollback steps are gone. Line 9 still says install/update/remove behavior stays as this document describes, and docs/design/plugins/LightOcr.md:179 and docs/design/plugins/RuntimeManager.md:83,150,171 rely on it.
Failure: PluginManager, LightOcr and RuntimeManager have no normative install or update flow left to implement.
Fix: keep §3.2 and §3.5, or move their steps into a target install flow section and point these references at it.
There was a problem hiding this comment.
Partially fixed in eca395a. The three target install flow pointers are gone and ### 3.7 Content registration exists at PluginManager.md:385, so the four inbound links resolve. Still open: section 2.1-2.3 define the manifest, plugins.json and the default configuration, not the install/update steps; the old section 3.2 Install and section 3.5 Update are one-line stubs or absent; and PluginManager.md:9 still says install/update/remove behavior stays as this document describes. See the body.
There was a problem hiding this comment.
Not fixed in 18d5e4f. Sections 2.1 to 2.3 still define the manifest, plugins.json and the default configuration, not the install or update steps; section 3.2 is a stub, section 3.5 is absent, lines 206, 274 and 324 still point at 2.1 to 2.3, and line 9 still says install/update/remove behavior stays as described. docs/design/plugins/LightOcr.md:5,53,140, RuntimeManager.md:83,150,171 and the open #2094 edit still rely on the removed sections.
| The acquisition and link-check code behind these rules is one crate-internal implementation, `crates/dim-app-server/src/plugin_manager/acquire.rs`, shared with the Skills installation ([Skills](Skills.md) §4), which reads a local directory or clones a repository for its own destination, staging directory and record. The rules above are stated once because there is one implementation. | ||
|
|
||
| ## 8. Rule check | ||
| ## Superseded anchors |
There was a problem hiding this comment.
Problem: this stub list omits 3.7 Content registration, so four links that resolved on origin/main now land nowhere: docs/design/appserver/mcp-management.md:30,1359, docs/design/appserver/mcp-oauth.md:496, docs/design/appserver/native-storage-format.md:512 and docs/architecture/rust-agent/plugins/Skills.md:77 use PluginManager.md#37-content-registration (origin/main had the heading at line 288). The retained text at lines 324 and 326 also still points at deleted §3.6, and line 355 at Skills §4.
Failure: the round-1 link audit still fails and the content-registration behavior those pages cite has no landing point.
Fix: add ### 3.7 Content registration to this list, retarget §3.6 and Skills §4, and keep the four links resolving in this PR.
There was a problem hiding this comment.
Fixed in eca395a. ### 3.7 Content registration is at PluginManager.md:385, and the four links from mcp-management.md:30,1359, mcp-oauth.md:496, native-storage-format.md:512 and architecture/rust-agent/plugins/Skills.md:77 now resolve; the old section 3.6 pointers in section 2.3 now read (content registration). One small leftover remains: PluginManager.md:355 still points at Skills section 4, which the retained Skills document no longer has.
|
|
||
| ```rust | ||
| let preview = skills.preview(source, selection, cancelled.clone()).await?; | ||
| let installed = skills.install(preview.token, selection, cancelled).await?; |
There was a problem hiding this comment.
Problem: the example still demonstrates the token flow and the document argument that the table above no longer defines. Line 55 calls register(ctx, plugin, dir, document) while the register row is {plugin, dir}; line 62 previews with selection and line 63 installs preview.token while the preview row returns {source, skills, conflicts, shadows, issues} with no token and install takes {source, id?, skills, overwrite}. The current methods match the table: skills.preview takes {source, id?, cwd?} (crates/dim-app-server/src/skills_management.rs:328-334) and install takes {source, id?, skills, overwrite} (skills_management.rs:337-344).
Failure: an implementer following the example sends fields the table does not define, and the document gives two incompatible install flows.
Fix: delete the token and document from the example and appendix, or restore the token flow everywhere and declare it as a client-visible change.
There was a problem hiding this comment.
Partially fixed in eca395a. The example now calls register(ctx, plugin, dir), preview(source, id, cwd, cancelled) and install(source, id, skills, overwrite, cancelled), and the appendix register signature is {plugin, dir} to Vec<SkillIssue>/SkillsError. Still open: Skills.md:141 returns a token, Skills.md:154 and the Rule check at 169 and 177 still describe an install token, and Skills.md:210 says the install token is a value. Retained section 2.3 at line 291 also says id is optional while the install row says {source, id, ...}.
There was a problem hiding this comment.
Not fixed in 18d5e4f. The token wording remains at Skills.md:141,154,169,177,210, and the install row still says {source, id, skills, overwrite} while the retained section at line 291 says id is optional (crates/dim-app-server/src/skills_management.rs:337-345).
|
|
||
| ### Client-visible changes | ||
|
|
||
| None. `skills.*` keep their client-visible behavior; `skills.install/update/remove` already never cancel after acceptance and settle or restore; `SkillsCatalogBinding` and `ConfigureControl` were plugin-facing; the `Skills` view and `skillsBranch.list` keep their values. |
There was a problem hiding this comment.
Problem: the heading says no client-visible change, but the table and the retained design still disagree with the current wire. skills.preview takes {source, id?, cwd?} (crates/dim-app-server/src/skills_management.rs:328-334), not {source, skills}. skills.install returns {installation, previous?, version, issues} (skills_management.rs:426-433), not {installation, previous?}. skills.update takes {id} and returns the same install result (skills_management.rs:351-355,828-858), not {id, revision?} to {installed}. skills.remove replies {version} (skills_management.rs:309-312,860-864), not {}. The install and update rows omit skills_selection_invalid, skills_install_conflict and skills_install_failed (crates/dim-agent-capabilities/src/skills/mod.rs:358-361), and the update row's missing contradicts retained §2.4's skills_install_unknown (line 309).
Failure: clients following the table break, and the document contradicts its own §2.3 and §2.4. e39c8d4 adds some skills_* codes to the Errors table, but the three install codes and the update/remove codes are still missing.
Fix: use the current shapes and codes, or declare the changes here and update §2.3, §2.4, the CLI and the Web client.
There was a problem hiding this comment.
Partially fixed in eca395a. The preview, install, update and remove shapes now match the current handlers. Still open: update and remove use missing, unmanaged, conflict, write_failed and delete_failed instead of skills_install_unknown, skills_install_unmanaged, skills_install_conflict, skills_install_failed, skills_write_failed and skills_remove_failed (crates/dim-agent-capabilities/src/skills/mod.rs:303-357); install still omits skills_selection_invalid, skills_install_conflict and skills_install_failed; the preview row names skills_invalid_source/skills_fetch_failed/skills_too_large while the boundary returns skills_source_invalid/skills_acquire_failed (crates/dim-app-server/src/skills_management.rs:483-499). The catalog, set_enabled and refresh rows also do not match {version, entries, issues}, {version} and {version, issues} (skills_management.rs:300-318,684-752).
| } | ||
| ``` | ||
|
|
||
| `SkillIssue` and `SkillsError` are the current types; `SkillDocument` is the catalog's private installation record. The target type names are marked in `skills/catalog.rs`; `SkillContentError` and `SkillListError` are `#[serde(rename_all = "snake_case")]` enums serialized as `{code, data}` with `message` in `data`; the wire `code` is the variant name and matches the error table. `From<CallError>` keeps the callback's own `code` and `message`. `CancelledFn` is the binding's cancellation argument, never a request field. `skillsBranch.list` takes `caller: &Ctx` and returns the current `SessionSkills` value. |
There was a problem hiding this comment.
Problem: the appendix still describes a wire shape the current binding does not produce and a register signature the table no longer defines. It says SkillContentError and SkillListError are #[serde(rename_all = "snake_case")] enums serialized as {code, data} with the message in data; the rutis binding throws {name, code, message, data} with message from Display and uses Debug as the code for a non-serializable error. The code block takes document: SkillDocument and returns SkillIssues, while the operation row is {plugin, dir} to {issues} and SkillDocument is the catalog's private installation record (crates/dim-app-server/src/skills_management.rs:43). SkillContentError, SkillListError and SkillIssues do not exist on origin/main.
Failure: the appendix cannot be implemented, and it reintroduces the installation record as the plugin document.
Fix: name the current types, state the real wire object, and make the signature {plugin, dir} to SkillIssue[]/SkillsError.
There was a problem hiding this comment.
Partially fixed in eca395a. The register signature is now {plugin, dir} to Vec<SkillIssue>/SkillsError. Still open: withdraw still returns SkillContentError and issues still returns SkillIssues, neither exists on origin/main; the paragraph still says SkillContentError and SkillListError serialize as {code, data} with the message in data, while the rutis 0.23 binding throws {name, code, message, data} with message from Display and Debug as the code fallback (rutis-bridge-0.23.0/src/exports.rs:23-33; rutis-0.23.0/src/service.rs:1044-1090).
| Each hook point was checked against what its owner exposes on `main`: | ||
| - **Sources.** The Settings documents `hooks` (user), `hooks-projects` and `hooks-plugins`; `.dimcode/hooks.json` is read through FileStorage under the project root Settings authorizes. The `hooksService.sources` data face is the only reader; there is no agent-crate port. | ||
| - **Content registration.** The hook document a plugin package carries, the holding plugin and its refusal. | ||
| - **One reader.** `sources(cwd)` resolves the user, project and plugin sources into the value a hook point reads. The management methods and the agent-crate port use this same reader. |
There was a problem hiding this comment.
Problem: this sentence contradicts the paragraph above it and the target's own reader decision. Line 15 now says hooksService.sources is the only reader and there is no agent-crate port, but this line says the management methods and the agent-crate port use this same reader; line 153 says the Session part reads through the port, line 166 calls the port a host binding, and line 167 says the agent crate uses the port. The same document deletes the SettingsHookSources duplicate (line 104), says the two readers are merged (line 164), and replaces HookSourcesHost (line 217).
Failure: an implementer cannot tell whether a Session or branch port survives; keeping one contradicts Supersedes and the one-reader decision.
Fix: say HooksSettings and the management methods use hooksService.sources, and HooksSession/HooksBranch read it through the process face; delete the agent-crate-port clauses at lines 17, 153, 166 and 167.
There was a problem hiding this comment.
Partially fixed in eca395a. Lines 15 and 17 now say HooksSession and HooksBranch read through the process face and the port is removed. Still open: Hooks.md:153 says the Session part reads the Settings source through the port, line 166 calls the port a host binding, and line 167 says the agent crate uses the port; they contradict lines 15 and 17 and Supersedes at line 217.
There was a problem hiding this comment.
Not fixed in 18d5e4f. Hooks.md:153 still says the Session part reads through the port, line 166 calls it a host binding, and line 167 says the agent crate uses it, while lines 15 and 17 and docs/design/contracts/resource-owner-operations.md:139 say the port is removed.
|
已按评审修改,head 评审处理:
自查 1–9:当前态断言按评审给的代码行核对;客户端形状已按第 3 节冻结;跨 PR 签名/错误码/共享文档留第二步;断链扫描 20 条均为 main 既有(timeline-branches、zh、interrupt、sessions-service、ContextCompaction),本 PR 引起的已用 stub/链接修正;新写句子按 1–5 复核。 left for step 2: |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: target contracts for the MCP, Hooks, Skills and PluginManager owners (refs #2022 and #2015). Round 3 reviews the full main...head at eca395a (12 files, +893/-1162) against origin/main 6e86d48c, including the delta over e39c8d4.
Delta note: eca395a aligns part of the MCP table (catalog, save, import.sources, temporary.capabilities, attach), the PluginManager list item and request fields, the Skills preview/install/update/remove shapes and caller example, the register signature, hooks.set_enabled, and it adds the ### 3.7 Content registration stub. It does not close the P2s below: several rows, the Errors tables and the new wire-code mapping lines still disagree with the code and with the retained documents.
Verdict: REQUEST_CHANGES. P1: none.
Round-2 status
Fixed in eca395a: 4675301456 (mcp.temporary.capabilities is {transports, leaseSeconds}), 4675301458 (attach uses invalid_params, mcp_binding_failed, mcp_binding_conflict and mcp_binding_missing), 4675301470 (### 3.7 Content registration is at PluginManager.md:385, and the four inbound links resolve).
Partially fixed: 4675301455 (catalog, save, import.sources, capabilities and attach; the other rows remain), 4675301461 (list item and request fields; replies and errors remain), 4675301466 (the target install flow pointers are gone; the flow itself is still absent), 4675301475 (example and register signature; the token text remains), 4675301479 (shapes; codes remain), 4675301483 (register signature; the other types and the wire description remain), 4675301487 (lines 15 and 17; lines 153, 166 and 167 remain).
Still open from round 2: P2-1 (remaining MCP rows), P2-2 (PluginManager results and errors), P2-3 (Skills codes and token), P2-4 (Hooks port), P2-5 (install/update flow), plus the new mapping contradiction in P2-6. P3-1 and P3-3 remain optional.
P2 findings
P2-1. Most MCP rows still rewrite client-visible shapes while Client-visible changes says None
Problem: Mcp.md:178 says no client-visible change, and the mcp-management.md banner says the client methods keep their current requests, replies and error codes, but only mcp.catalog, mcp.save, mcp.import.sources, mcp.temporary.capabilities, mcp.inspect and mcpSession.state match the code. mcp.configuration takes {cwd?, id, source} and replies {revision?, enabled, secretsInUserScope, configuration} (crates/dim-app-server/src/mcp/management.rs:52-58,479-489,814-831), not {id, project?} to {entry}. mcp.update takes {cwd?, id, source, expectedVersion, patch} and replies {} (management.rs:128-137,833-859), and retained docs/design/appserver/mcp-management.md:134,168 says the four writes keep {}. mcp.remove and mcp.set_enabled take source and expectedVersion (management.rs:60-68,403-409), mcp.move takes {cwd?, id, from, to, expectedFromVersion, expectedToVersion} (management.rs:40-49), mcp.import.preview and mcp.import.apply take source, from and expectedVersion and reply ImportPreview and {revision} (management.rs:86-124,1107-1175; crates/dim-app-server/src/mcp/import.rs:128-157), mcp.test takes {cwd?, id, source, configuration?, patch?} and replies {status, latencyMs, tools, expired?, missingScopes?, reason?, message?} (management.rs:139-150; crates/dim-app-server/src/mcp.rs:185-202), mcp.disconnect takes {cwd?, id, source} (management.rs:1176-1187), and mcp.auth.start/complete/cancel/logout use {cwd?, id, source, clientSecret?}, {attemptId, callbackUrl}, {attemptId} and {cwd?, id, source} (management.rs:412-438,1188-1245). Renew and detach still say {binding} and invalid/missing instead of {sessionId, bindingId} and invalid_params/mcp_binding_missing (crates/dim-app-server/src/mcp/temporary.rs:51-58,86-92,331-335). The new save row also omits mcp_settings_conflict, mcp_credentials_are_user_scoped and mcp_stale_secret_record, which the save handler can return (management.rs:504-528,933-1018).
Failure scenario: the Web MCP editor sends {cwd, id, source, expectedVersion, patch} to mcp.update (web/src/features/settings/McpSettings.vue:376), {cwd, id, source, expectedVersion, enabled} to mcp.set_enabled, {cwd, id, source, expectedVersion} to mcp.remove, {cwd, id, from, to, expectedFromVersion, expectedToVersion} to mcp.move (McpSettings.vue:419-469), {cwd, id, source, patch|configuration} to mcp.test (McpSettings.vue:390-404) and {attemptId, callbackUrl} to mcp.auth.complete (McpSettings.vue:486), and reads mcp.configuration as {revision, enabled, secretsInUserScope, configuration} (web/src/rpc/general-settings.ts:168-172). The request structs use deny_unknown_fields, so a daemon implemented from these rows answers invalid_params to every one of those calls.
Evidence: the structs and handlers cited above; the banners at docs/design/appserver/mcp-management.md:2 and docs/design/plugins/TemporaryMcp.md:1; the retained write rule at mcp-management.md D6.
Fix: restore the current requests, replies and codes in every row, or declare each rename under Client-visible changes and update mcp-management.md, mcp-apps.md, TemporaryMcp.md, the CLI and the Web client in the same change.
P2-2. PluginManager still claims no client-visible change while its results and errors differ
Problem: PluginManager.md:124 says plugin.* keep their commands, results and errors, but four parts still disagree. First, plugin.list merges status, waitingFor, error and refused into each item (crates/dim-app-server/src/plugin_manager.rs:2210-2275), and the row lists only {name, use, off, locked, candidates, optional?, update?}. Both clients read the merged fields (web/src/rpc/general-settings.ts:91-112; crates/dim-cli/src/plugin_command.rs:199-225). Second, install, enable and reload do not reply the status map in the rows: install replies the loader status object plus id, name, enabled, locked? and the optional outcomes (plugin_manager.rs:1354-1364,625-645), while enable and reload reply the status object plus optional outcomes (plugin_manager.rs:1501-1504,1565-1670). Third, plugin.remove rejects a ref (plugin_manager.rs:1206-1213), so {id, ref?} is wrong. Fourth, the Errors columns invent or omit codes: install lists not_updatable and not_removable, which only update and remove return (plugin_manager.rs:1530,1689); enable lists not_reloadable and node_unavailable, which enable never returns (plugin_manager.rs:1457-1504); reload lists plugin_locked, which reload never checks (plugin_manager.rs:1565-1670); remove lists plugin_locked, which remove never checks (plugin_manager.rs:1527-1564).
Failure scenario: the Web plugin page decodes status, error and refused from plugin.list (web/src/features/settings/PluginSettings.vue:41,98); a daemon built from the row returns none of them, so every plugin renders as content-only with no failure text and content refusals vanish. A client that sends ref to remove gets invalid_params, and a client matching plugin_locked on reload waits for an error the daemon never sends.
Evidence: the cited handlers and decoders; the Errors table at PluginManager.md:91-102 and the new mapping at line 172, which do not agree on the code set (P2-6).
Fix: add the status fields to the list item and the operation replies, make remove {id}, and make each Errors column equal the codes its handler returns.
P2-3. Skills rows still use non-current replies and codes
Problem: the delta fixed preview/install/update/remove reply shapes, but three other client rows still do not match, and the error codes remain old. skills.catalog takes {cwd?} and replies {version, entries, issues} (crates/dim-app-server/src/skills_management.rs:684-752,300-307), not {project?} to {skills, projects, invalid}. skills.set_enabled takes {cwd?, id, enabled} and replies {version} (skills_management.rs:254-264,691-713,310-313), not {id, enabled, project?} to {}. skills.refresh takes {cwd?} and replies {version, issues} (skills_management.rs:715-741,314-318), not {} to {generation}. The update row uses missing, unmanaged, conflict and write_failed, while the code returns skills_install_unknown, skills_install_unmanaged, skills_install_conflict, skills_install_failed, skills_write_failed, skills_conflict and closed (crates/dim-agent-capabilities/src/skills/mod.rs:303-357; skills_management.rs:828-858); remove says delete_failed instead of skills_remove_failed (skills_management.rs:860-864). The install row omits skills_selection_invalid, skills_install_conflict and skills_install_failed, and says {source, id, ...} while id is optional (skills_management.rs:337-345; retained §2.3 at line 291). The preview row names skills_invalid_source, skills_fetch_failed and skills_too_large, while the boundary returns skills_source_invalid and skills_acquire_failed (skills_management.rs:483-499). The token text also survives at Skills.md:141,154,169,177,210.
Failure scenario: the Web Skills page decodes {version, entries, issues} (web/src/rpc/general-settings.ts:83-90); a daemon built from the catalog row returns no version, so number(source.version) throws and the page shows no Skills. The CLI calls skills.catalog and skills.refresh with {cwd} (crates/dim-cli/src/management/skills.rs:78-110), which the rows do not describe. A client keyed on missing or delete_failed does not recognize the daemon's skills_install_unknown or skills_remove_failed, and the document still describes an install token that the wire does not return.
Evidence: the handlers and enums cited above; the Errors table addition at Skills.md:132 does not match the rows.
Fix: use the current catalog/set_enabled/refresh requests and replies, use the current codes in preview/install/update/remove, mark id?, and delete the token text from Flows, Exceptions, Rule check and the appendix.
P2-4. Hooks still asserts an agent-crate port that the target deletes
Problem: the delta fixes lines 15 and 17, but three clauses still assert the removed port. Hooks.md:153 says the Session part reads the Settings source through the port; line 166 says the port is a host binding, not a facade; line 167 says the agent crate uses the port. Lines 15 and 17 say There is no agent-crate port and the port is removed, Supersedes at line 217 replaces HookSourcesHost and the two-reader design, line 104 deletes SettingsHookSources, and docs/design/contracts/resource-owner-operations.md:139 says the agent-crate port is removed. Origin/main still has HookSourcesHost at crates/dim-agent-capabilities/src/hooks/sources.rs:77, so a reader can also read the old type as current.
Failure scenario: an implementer cannot tell whether a Session or branch source port survives. Keeping one contradicts the one-reader decision and Supersedes; rebuilding it reintroduces the two-reader design this PR removes.
Evidence: docs/design/plugins/Hooks.md:15,17,104,153,166,167,217; docs/design/contracts/resource-owner-operations.md:139.
Fix: say HooksSession and HooksBranch read through hooksService.sources/the process face in both Rule check rows, and delete the port clauses at lines 153, 166 and 167.
P2-5. PluginManager still has no install or update flow, and the new pointers are false
Problem: the delta replaces the three target install flow pointers with the install/update behavior in §2.1-§2.3 (PluginManager.md:206,274,324), but those sections define the manifest, plugins.json and the default configuration file, not the install/update steps. The old §3.2 Install and §3.5 Update are one-line stubs now (PluginManager.md:373), and there is no §3.5 stub at all. The target contract's Flows table has one line for install/update, so the staging, dependency install, record CAS and rollback sequence is gone. PluginManager.md:9 still says install/update/remove behavior stays as this document describes, and docs/design/plugins/LightOcr.md:5,53,140 and docs/design/plugins/RuntimeManager.md:83,150,171 still rely on the removed sections.
Failure scenario: PluginManager, LightOcr and RuntimeManager have no normative install or update sequence to implement, and a reader who follows the new pointer finds no steps. The document also asserts that behavior is unchanged while deleting its description.
Evidence: docs/design/plugins/PluginManager.md:9,206,274,324,373; the current §2.1-§2.3 headings at lines 180, 238 and 307.
Fix: keep §3.2 and §3.5 or move their steps into a target install/update flow section, point the three references at that section, and make line 9 match what remains.
P2-6. The new wire-code mapping lines are not mappings and contradict the Errors tables
Problem: eca395a appends Wire-code mapping (internal variant -> published code) to three binding appendices, but each line lists only published codes and no internal variants, and each list disagrees with its Errors table. PluginManager.md:172 lists not_updatable, not_removable, not_reloadable, name_changed, acquire_failed, optional_not_found, node_unavailable and dependencies_failed, which are absent from the Errors table at lines 91-102, while the table keeps exists, missing, load_failed, restart_required, content_refused, write_failed and usage, which the mapping omits. Mcp.md:238 lists four management app errors (mcp_invalid_config, mcp_settings_read, service_reloading, operation_interrupted), while the Errors table at lines 148-162 lists many more and the appendix is about the mcpSession/mcpService enums. Hooks.md:195 lists hooks_invalid, hooks_conflict and hooks_failed, which belong to hooks.*, not to the hooksService enums in the same paragraph. The paragraph also says one variant per error table code, so the mapping and the table cannot both be the target enum. rutis 0.23 publishes the serde tag as the code (rutis-0.23.0/src/service.rs:1044-1090), so the variant names are the contract.
Failure scenario: an implementer either creates variants the Errors table does not define or omits variants the table does define, and the wire codes a client matches change depending on which paragraph is followed.
Evidence: the three appended lines and the three Errors tables; crates/dim-app-server/src/plugin_manager/management.rs:15-43 is the current code set.
Fix: make each Errors table the single code set, replace the list with variant -> tag pairs for exactly that set, or state that every variant is named exactly after its table code and delete the partial list.
P3 optional findings
- Binding appendices still name non-current types and a wrong wire shape.
Hooks.md:195callsHooksContentErrora current type and the signature usesHooksContentError/HookSourceError/HookSources; none exists on origin/main, and the current names areHookRefusal(a type alias),HookSourcesSnapshot(crates/dim-agent-capabilities/src/hooks/sources.rs:61) andHooksDocument(hooks/document.rs:101).Skills.md:202,204,208still hasSkillContentError,SkillIssuesandSkillListError, none exists, and it says they serialize as{code, data}with the message indata; rutis 0.23 throws{name, code, message, data}withmessagefromDisplayandDebugas the code fallback (rutis-bridge-0.23.0/src/exports.rs:23-33;rutis-0.23.0/src/service.rs:1044-1090).Mcp.md:230-233usesMcpDocumentandMcpViewwhile the current types areMcpPluginDocumentandMcpWidgetResult, and onlyPublishedToolRefis marked target. Mcp.md:7leaves## Supersedesempty and keeps the Replaces paragraph under## Target contract.Skills.md:151still names the deleted§6, andPluginManager.md:355still points atSkills §4, a section the retained Skills document no longer has.- Requirements still cite #2026/#2027/#2028 for names whose contracts are in #2103/#2100/#2102 (
Skills.md:175,188-189;Hooks.md:161,173-174;PluginManager.md:140,154-155).
Cross-PR note
Target names agree with the series where checked: FileStorage root_path/read/write/remove/list (#2080), SessionScope mount/unmount/config (#2093), Settings operations (#2094), ManagementMethods register (#2095), Permission advise and Approval decide (#2100), Prompt adoption configure (#2102), and ToolRegistry/SessionMethods register (#2103).
The overlapping files still need a merge order. The same series PRs are open and edit these documents: #2100 edits docs/design/plugins/Hooks.md, #2094 edits docs/design/plugins/PluginManager.md, #2080/#2091/#2094/#2096/#2098/#2099 edit docs/design/contracts/resource-owner-operations.md, #2095/#2097/#2100/#2102/#2103 edit docs/design/contracts/session-boundary.md, and nearly every series PR edits docs/design/service-faces.md and docs/design/plugins/README.md. The PR is MERGEABLE against current main, and main's only overlapping docs change since the merge base is a different part of resource-owner-operations.md, so no textual conflict was found. The second PR to merge can still reintroduce deleted sections or old anchors.
Checks
LC_ALL=en_US.UTF-8 node scripts/adr-check.mjs --base 5a279d6988c80692a77f3438fff4d26f7875e4c9 passes on eca395a (ADR freeze passed: 12 changed files). CI on eca395a: changes and ci-ok pass; acp-registry, dependencies, macos-native, scripts, static-checks, web, windows-cli and verify are skipped for this documentation-only diff. I did not run the Rust test suite. The Desktop client is not in this repository, so its use of the changed MCP fields is inferred from the Web and CLI call sites. The GitHub files API returns no patch for Hooks.md (large diff), so no new inline comment is anchored there; the Hooks remainders are covered in the reply and this body.
| | `mcp.catalog` | The merged servers and their revisions | `{cwd?}` | `{servers, userRevision, projectRevision, userApplication, pluginApplication, projectApplication, invalid}` | Read can be cancelled | `mcp_invalid_config`, `service_reloading`, `operation_interrupted`, `closed`, `cancelled` | | ||
| | `mcp.configuration` | One entry's declared and effective view | `{id, project?}` | `{entry}` | Read can be cancelled | `missing`, `closed`, `cancelled` | | ||
| | `mcp.save` | Create or replace one entry at a revision | `{cwd?, id, source, expectedVersion, configuration}` | `{}` | Accepted write is not cancelled | `mcp_invalid_config`, `mcp_settings_read`, `service_reloading`, `operation_interrupted`, `closed` | | ||
| | `mcp.update` | Change selected fields at a revision | `{id, revision, patch}` | `{entry, revision}` | Accepted write is not cancelled | `invalid`, `missing`, `conflict`, `closed` | |
There was a problem hiding this comment.
Problem: this row and the rows below still describe shapes the code does not use, so the None claim at Mcp.md:178 cannot hold. mcp.update takes {cwd?, id, source, expectedVersion, patch} and replies {} (crates/dim-app-server/src/mcp/management.rs:128-137,833-859; retained docs/design/appserver/mcp-management.md:134,168 says the writes keep {}). mcp.configuration takes {cwd?, id, source} and replies {revision?, enabled, secretsInUserScope, configuration} (management.rs:52-58,479-489,814-831), not {id, project?} to {entry}. mcp.remove, mcp.set_enabled, mcp.move, mcp.import.preview, mcp.import.apply, mcp.test, mcp.disconnect and mcp.auth.* differ the same way (management.rs:40-150,403-438,1019-1245; crates/dim-app-server/src/mcp.rs:185-202).
Failure: the Web editor sends {cwd, id, source, expectedVersion, patch} to mcp.update (web/src/features/settings/McpSettings.vue:376) and reads mcp.configuration as {revision, enabled, secretsInUserScope, configuration} (web/src/rpc/general-settings.ts:168-172); the request structs use deny_unknown_fields, so a daemon built from these rows answers invalid_params to every edit, enable, remove, move, probe, disconnect and sign-in.
Fix: use the current requests, replies and codes in these rows, or list each rename under Client-visible changes and update mcp-management.md, mcp-apps.md, the CLI and the Web client.
There was a problem hiding this comment.
Not fixed in 18d5e4f. The delta only adds the kind mapping at Mcp.md:178; mcp.configuration, mcp.update, mcp.remove, mcp.set_enabled, mcp.move, mcp.import.preview, mcp.import.apply, mcp.test, mcp.disconnect, mcp.auth.* and renew/detach still show requests or replies the code does not use (crates/dim-app-server/src/mcp/management.rs:40-150,412-439,479-485; crates/dim-app-server/src/mcp.rs:184-201; crates/dim-app-server/src/mcp/temporary.rs:51-58), and mcp.save still omits mcp_settings_conflict, mcp_credentials_are_user_scoped and mcp_stale_secret_record (management.rs:505-528).
| | `mcpSession.widget` | The view for one published tool | `{publishedTool}` | `{view}` or absent | The client dropping the call cancels the read | `absent`, `unsupported`, `not_callable`, `unknown_server`, `unavailable`, `refused`, `unknown`, `closed` | | ||
| | `mcpSession.call` | One MCP Apps call | `{server, tool, args}` | `{result}` | The client dropping the call cancels the resource read | `unknown_server`, `unavailable`, `refused`, `unknown`, `cancelled`, `closed` | | ||
| | `session.mcp_temporary.attach` | Mount a client temporary binding | `{sessionId, bindingId, servers}` | `{}` | The caller dropping the call shuts the half-made binding | `invalid_params`, `mcp_binding_failed`, `mcp_binding_conflict`, `mcp_binding_missing`, `cancelled`, `closed` | | ||
| | `session.mcp_temporary.renew` | Extend the binding lease | `{binding}` | `{}` | None | `invalid`, `missing`, `closed` | |
There was a problem hiding this comment.
Problem: the attach row was corrected, but renew and detach still say {binding} and invalid/missing. Current Address is {sessionId, bindingId} (crates/dim-app-server/src/mcp/temporary.rs:51-58); a bad request is invalid_params, and a gone binding is mcp_binding_missing (temporary.rs:86-92,331-335).
Failure: a client that renews with {sessionId, bindingId} is refused invalid_params; one matching missing does not recognize mcp_binding_missing, while the section says no client-visible change.
Fix: use {sessionId, bindingId} and invalid_params/mcp_binding_missing (plus closed) in both rows.
There was a problem hiding this comment.
Not fixed in 18d5e4f. Mcp.md:141-142 still say {binding} and invalid/missing; the current request is {sessionId, bindingId} (crates/dim-app-server/src/mcp/temporary.rs:51-58), a bad request is invalid_params, and a gone binding is mcp_binding_missing (temporary.rs:73-92).
| } | ||
| ``` | ||
|
|
||
| `session.mcp_temporary.attach/renew/detach` are `SessionMethods` registrations; `attach` takes `caller: &Ctx` and the binding id is bound to the caller's Session row. Current types: `McpPluginDocument`, `McpPluginRefusal`, `McpWidgetResult` and the `mcp/management.rs`/`mcp/session.rs` request and reply structs; `PublishedTool` is private, so the target exposes a public `PublishedToolRef` value instead. Target error enums use `#[derive(Debug, serde::Serialize, thiserror::Error)]` and `#[serde(tag = "code", rename_all = "snake_case")]`; one variant per error table code; a callback failure is `Rejected { reason, message }` with wire code `rejected`. The current `McpAppError` is a non-serializable `thiserror` enum and is marked target. `From<rutis::host::CallError>` is implemented where a callback failure must propagate. `CancelledFn` is the binding's cancellation argument, never a request field. The temporary-crate check with rustc 1.100.0 passed; every target error enum carries `#[error("...")]` for `Display`. Wire-code mapping (internal variant -> published code): mcp_invalid_config, mcp_settings_read, service_reloading, operation_interrupted. |
There was a problem hiding this comment.
Problem: this line is not a mapping. It names four published codes and no internal variant, and the paragraph says one variant per error table code while Mcp.md:148-162 lists many more. The four listed codes are management-method app errors, not the mcpSession/mcpService service errors this appendix describes. rutis 0.23 publishes the serde tag as the code (rutis-0.23.0/src/service.rs:1044-1090), so the variant names are the contract.
Failure: an implementer cannot tell which target enum publishes which code; following the four-code list leaves absent, unsupported, invalid_document, settings_write and the rest undefined, while following the table contradicts this paragraph.
Fix: list each target variant with its snake_case tag, or state that every variant is named exactly after its Errors-table code and delete the partial list.
There was a problem hiding this comment.
Not fixed in 18d5e4f. Mcp.md:238 still lists four published codes and no internal variants, and the new paragraph at Mcp.md:178 adds a second, incomplete mapping: missing, conflict, settings_write, settings_conflict, user_scope and the mcp_app_* codes at Mcp.md:138-139 are not resolved. See the new inline comments on 178 and 138.
|
|
||
| ### Client-visible changes | ||
|
|
||
| None. `plugin.*` and the `plugin` tool keep their commands, results and errors; the `Manager` handoff was a Session-part implementation detail. |
There was a problem hiding this comment.
Problem: None still does not hold. plugin.list merges status, waitingFor, error and refused into each item (crates/dim-app-server/src/plugin_manager.rs:2210-2275), and clients read them (web/src/rpc/general-settings.ts:91-112; crates/dim-cli/src/plugin_command.rs:199-225); the row above omits them. Install, enable and reload do not reply the status map in the rows: install is the loader status object plus id, name, enabled, locked? and the optional outcomes (plugin_manager.rs:1354-1364,625-645), while enable and reload are the status object plus optional outcomes (plugin_manager.rs:1501-1504,1565-1670). plugin.remove rejects a ref (plugin_manager.rs:1206-1213), so {id, ref?} is wrong.
Failure: a daemon built from the rows returns no status or error, so the Web plugin page shows every name as content-only with no failure text (web/src/features/settings/PluginSettings.vue:41,98); a client that sends ref to remove is refused invalid_params.
Fix: add the status fields to the list item and to each reply, make remove {id}, and align the Errors columns with the same pass.
There was a problem hiding this comment.
Not fixed in 18d5e4f. The delta only edits the Client-visible paragraph at line 124; plugin.list still omits status, waitingFor, error and refused (crates/dim-app-server/src/plugin_manager.rs:2261-2275), the install, enable and reload replies are not the status map in the rows (plugin_manager.rs:1362-1374,1502-1504,1667-1670), plugin.remove still rejects ref (plugin_manager.rs:1206-1213), and the Errors columns still invent or omit codes.
| ); | ||
| ``` | ||
|
|
||
| `manager` is the process owner's operation/callback, not the `Manager` object. The current `PluginError` is a struct; the target replaces it with `#[derive(Debug, serde::Serialize, thiserror::Error)]` and `#[serde(tag = "code", rename_all = "snake_case")]`, one variant per error table code; a callback failure is `Rejected { reason, message }` with wire code `rejected`. `From<rutis::host::CallError>` is implemented where a callback failure must propagate. `CancelledFn` is the binding's cancellation argument, never a request field. The `PluginTools` `manager` field is deleted; the install/update/remove result values remain. The temporary-crate check with rustc 1.100.0 passed; every target error enum carries `#[error("...")]` for `Display`. Wire-code mapping (internal variant -> published code): plugin_not_found, plugin_exists, plugin_locked, invalid_params, invalid_id, path_outside_plugins, not_updatable, not_removable, not_reloadable, name_changed, invalid_source, invalid_manifest, acquire_failed, optional_not_found, node_unavailable, dependencies_failed. |
There was a problem hiding this comment.
Problem: the mapping contradicts the Errors table and the rows. The list has not_updatable, not_removable, not_reloadable, name_changed, acquire_failed, optional_not_found, node_unavailable and dependencies_failed; the Errors table at lines 91-102 has none of them and keeps exists, missing, load_failed, restart_required, content_refused, write_failed and usage. The sentence says one variant per error table code, so the two sets cannot both be the target enum. The current wire codes are the management description set (crates/dim-app-server/src/plugin_manager/management.rs:15-43).
Failure: an implementation of this list has variants the table does not define, and a client that handles the table's codes cannot match the daemon's real errors.
Fix: make the Errors table the single code set, then make this list exactly that set with each variant's tag, or delete it.
There was a problem hiding this comment.
Not fixed in 18d5e4f. The new paragraph at line 124 adds a second mapping that disagrees with this list: it adds refused and record_unreadable, omits seven codes listed here, and maps write_failed, usage, load_failed and restart_required to codes the daemon does not return. See the new inline comment on 124.
| | `skillsCatalog.plugins` | The packages holding Skill roots | `{}` | `{plugins}` | None | `closed` | | ||
| | `skillsCatalog.issues` | The scan issues of a package | `{plugin}` | `{issues}` | None | `closed` | | ||
| | `skillsCatalog.query` | The Session's view source for a cwd | `{cwd}` | `{skills, generation, errors}` | The read can be cancelled | `unavailable`, `closed`, `cancelled` | | ||
| | `skills.catalog` | The client catalog | `{project?}` | `{skills, projects, invalid}` | The read can be cancelled | `invalid`, `closed`, `cancelled` | |
There was a problem hiding this comment.
Problem: skills.catalog still says {project?} to {skills, projects, invalid}, but the handler takes {cwd?} and replies {version, entries, issues} (crates/dim-app-server/src/skills_management.rs:684-752,300-307). skills.set_enabled says {id, enabled, project?} to {} while the code takes {cwd?, id, enabled} and replies {version} (skills_management.rs:254-264,691-713,310-313). skills.refresh says {} to {generation} while the code takes {cwd?} and replies {version, issues} (skills_management.rs:715-741,314-318).
Failure: the Web Skills page decodes {version, entries, issues} (web/src/rpc/general-settings.ts:83-90); a daemon built from this row returns no version, so every load throws. The CLI calls skills.catalog and skills.refresh with {cwd} (crates/dim-cli/src/management/skills.rs:78-110), which the rows do not describe, while the section says no client-visible change.
Fix: use the current requests and replies, or declare these as client-visible changes.
There was a problem hiding this comment.
Not fixed in 18d5e4f. skills.catalog is still {project?} to {skills, projects, invalid}, skills.set_enabled is still {id, enabled, project?} to {}, and skills.refresh is still {} to {generation}; the code is {cwd?} to {version, entries, issues}, {cwd?, id, enabled} to {version}, and {cwd?} to {version, issues} (crates/dim-app-server/src/skills_management.rs:299-310,684-751).
| | `skills.set_enabled` | Enable or disable a Skill or project | `{id, enabled, project?}` | `{}` | Accepted write is not cancelled | `missing`, `invalid`, `conflict`, `closed` | | ||
| | `skills.refresh` | Rescan the roots | `{}` | `{generation}` | None; the scan is the owner's | `closed` | | ||
| | `skills.preview` | Preview a local or Git source | `{source, id?, cwd?}` | `{source, skills, conflicts, shadows, issues}` | The read can be cancelled | `skills_invalid_source`, `skills_fetch_failed`, `skills_too_large`, `cancelled`, `closed` | | ||
| | `skills.install` | Install the selected entries | `{source, id, skills, overwrite}` | `{installation, previous?, version, issues}` | Accepted work is not cancelled; it settles or restores | `skills_preview_stale`, `skills_install_exists`, `skills_install_unmanaged`, `skills_install_unknown`, `skills_write_failed`, `closed` | |
There was a problem hiding this comment.
Problem: the shapes are current, but the errors and the install id are not. skills.update returns skills_install_unknown, skills_install_unmanaged, skills_install_conflict, skills_install_failed, skills_write_failed, skills_conflict and closed (crates/dim-agent-capabilities/src/skills/mod.rs:303-357; crates/dim-app-server/src/skills_management.rs:828-858), not missing, unmanaged, conflict and write_failed; remove returns skills_remove_failed, not delete_failed (skills/mod.rs:332-357; skills_management.rs:860-864). The install row omits skills_selection_invalid, skills_install_conflict and skills_install_failed, and says {source, id, ...} while id is optional (skills_management.rs:337-345; retained section 2.3 at line 291). The preview row names skills_invalid_source, skills_fetch_failed and skills_too_large, while the boundary returns skills_source_invalid and skills_acquire_failed (skills_management.rs:483-499).
Failure: a client keyed on the row's missing does not recognize the daemon's skills_install_unknown; a client built from the install row always sends an id; a preview client handles codes the daemon never sends.
Fix: use the current codes in all three rows, mark id?, and use the boundary's preview codes.
There was a problem hiding this comment.
Not fixed in 18d5e4f. Update and remove still use missing, unmanaged, conflict, write_failed and delete_failed; install still requires id and omits skills_selection_invalid, skills_install_conflict and skills_install_failed; preview still names skills_invalid_source, skills_fetch_failed and skills_too_large, which do not exist. Current codes are in crates/dim-agent-capabilities/src/skills/mod.rs:350-361 and crates/dim-app-server/src/skills_management.rs:483-499.
| | `skills_preview_stale` | Re-preview; the source moved | | ||
| | `skills_install_exists`, `skills_install_unmanaged`, `skills_install_unknown` | Re-read the record and choose an id/selection | | ||
| | `skills_write_failed` | Report the partial state; retry update/remove | | ||
| | `skills_selection_invalid`, `skills_install_conflict`, `skills_install_failed`, `skills_remove_failed` | Fix the selection or retry the write/remove | |
There was a problem hiding this comment.
Problem: this row adds four codes that the Operations rows do not use, so the table and the rows disagree. The install row still omits skills_selection_invalid, skills_install_conflict and skills_install_failed; update still uses missing, unmanaged, conflict and write_failed; remove still uses missing, unmanaged and delete_failed. The current set is crates/dim-agent-capabilities/src/skills/mod.rs:346-364.
Failure: an implementer cannot produce one error enum: the row codes and this table name different variants for the same operation, and clients built from either miss the other's refusals.
Fix: replace the old row codes with this table's codes and make the preview row use skills_source_invalid/skills_acquire_failed.
There was a problem hiding this comment.
Not fixed in 18d5e4f. The table still mixes old kinds with new codes, and the operations rows do not use skills_selection_invalid, skills_install_conflict, skills_install_failed or skills_remove_failed. Make the table and the rows one code set.
|
已按评审修改,head 跨 PR / 客户端可见:
验证: |
|
补充说明(ADR 027 收回到决定层后):本 PR 的契约没有 |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: target contracts for the MCP, Hooks, Skills and PluginManager owners (refs #2022 and #2015). Round 4 reviews the full main...head at 18d5e4f (12 files, +893/-1162) against origin/main decc589, including the one-commit delta over eca395a.
Delta note: 18d5e4f changes three lines: Mcp.md:157 adds (wire code mcp_binding_failed) and Mcp.md:178 plus PluginManager.md:124 add kind-to-code mapping paragraphs. The attach row is correct, but the mapping paragraphs are false or incomplete and close none of the six P2s.
Verdict: REQUEST_CHANGES. P1: none.
P2 findings
P2-1 (new in the delta; round 3 P2-6 remains). The mapping paragraphs do not map the current wire codes
Problem: PluginManager.md:124 maps content_refused to refused, write_failed to record_unreadable, load_failed and restart_required to acquire_failed, and usage to invalid_params. None of these is current. A content refusal is a refused reply array, not an error code (crates/dim-app-server/src/plugin_manager.rs:628-650,2261-2275); a failed plugins.json write is acquire_failed (plugin_manager.rs:1168-1170), while record_unreadable is a read error (plugin_manager/record.rs:226); restartRequired is a successful outcome flag and a load failure is status: "failed" plus error (plugin_manager.rs:628-650,2297-2310); usage is a tool result text (plugin_manager/tools.rs:355-360). Mcp.md:178 maps missing to "the existing not-found code of each method", but management methods answer mcp_unknown_server (crates/dim-app-server/src/mcp/management.rs:512; retained docs/design/appserver/mcp-management.md:790) or mcp_invalid_config (mcp.rs:838-839, management.rs:510), not a not-found code; only the temporary binding answers mcp_binding_missing (mcp/temporary.rs:86-92). invalid maps to invalid_params only for decode failures: mcp.auth.complete answers mcp_auth_callback_invalid or mcp_auth_attempt_closed (mcp/auth.rs:51-62), and the current session.mcp.app codes are mcp_app_absent, mcp_app_unsupported, mcp_app_not_callable, mcp_unknown_server, mcp_unavailable, mcp_app_refused and mcp_app_unknown (crates/dim-app-server/src/connection/mcp.rs:41-50), not the bare kind names at Mcp.md:138-139. The kinds conflict, settings_write, settings_conflict and user_scope are left unmapped, although the current codes are mcp_settings_conflict, mcp_move_conflict, mcp_import_conflict, mcp_settings_read and mcp_credentials_are_user_scoped (management.rs:505-528), and settings_write does not exist today: the content face routes every error through management::error (mcp/face.rs:84-95). Neither paragraph says where the conversion happens; Mcp.md:238 and PluginManager.md:172 say one variant per error table code, and rutis publishes the serde tag as the code (rutis-0.23.0/src/service.rs:1062-1080), so a variant named for a kind publishes that kind. The two PluginManager statements also disagree: line 172 has not_updatable, not_removable, not_reloadable, name_changed, optional_not_found, node_unavailable and dependencies_failed and lacks refused and record_unreadable.
Failure: a daemon implemented from these paragraphs publishes missing, conflict, settings_write, user_scope, absent or refused where clients match mcp_unknown_server, mcp_settings_conflict, mcp_credentials_are_user_scoped or mcp_app_*, and a client matching record_unreadable on a failed write never sees it because the daemon sends acquire_failed. The None heading is false in both documents.
Evidence: the mapping paragraphs, the two appendix lines and the code citations above.
Fix: give one complete kind-to-code table per family, state that the management-methods boundary performs the conversion (or name the serialized variants after the wire codes), make the Errors tables' Kind column the internal set only, and merge the duplicate PluginManager lists at 124 and 172.
P2-2 (round 3 P2-1). Most MCP rows still rewrite client-visible shapes while Client-visible changes says None
Problem: Mcp.md:178 says no client-visible change, but most client rows still describe shapes the code does not use. mcp.configuration is {cwd?, id, source} to {revision?, enabled, secretsInUserScope, configuration} (crates/dim-app-server/src/mcp/management.rs:52-58,479-485), not {id, project?} to {entry} (Mcp.md:119). mcp.update is {cwd?, id, source, expectedVersion, patch} to {} (management.rs:128-137), not {id, revision, patch} to {entry, revision} (Mcp.md:121). mcp.remove, mcp.set_enabled and mcp.move take source and expectedVersion (management.rs:60-68,40-49), and mcp.move has from/to, not before? (Mcp.md:122-124). mcp.import.preview and mcp.import.apply take source, document, from and expectedVersion and reply ImportPreview and {revision} (management.rs:86-126,1107-1175), not the rows at Mcp.md:125-126. mcp.test takes {cwd?, id, source, configuration?, patch?} and replies {status, latencyMs, tools, expired?, missingScopes?, reason?, message?} (management.rs:139-150; mcp.rs:184-201), not {config, timeout?} to {status, latency, tools, reason} (Mcp.md:129). mcp.disconnect and mcp.auth.* take {cwd?, id, source} and {attemptId, callbackUrl} (management.rs:412-439), not the rows at Mcp.md:131-135. Renew and detach still say {binding} and invalid/missing instead of {sessionId, bindingId} and invalid_params/mcp_binding_missing (mcp/temporary.rs:51-58,86-92; Mcp.md:141-142). The save row also omits mcp_settings_conflict, mcp_credentials_are_user_scoped and mcp_stale_secret_record (management.rs:505-528).
Failure: the Web editor sends {cwd, id, source, expectedVersion, patch} to mcp.update (web/src/features/settings/McpSettings.vue:376), {cwd, id, source, expectedVersion} to mcp.remove, {cwd, id, from, to, expectedFromVersion, expectedToVersion} to mcp.move (McpSettings.vue:446,469), {attemptId, callbackUrl} to mcp.auth.complete (McpSettings.vue:486) and reads mcp.configuration as {revision, enabled, secretsInUserScope, configuration} (web/src/rpc/general-settings.ts:167-170). The request structs use deny_unknown_fields, so a daemon implemented from these rows answers invalid_params to every one of those calls.
Evidence: the handlers and structs above; the retained banners at docs/design/appserver/mcp-management.md:2 and docs/design/plugins/TemporaryMcp.md:1; the write rule at mcp-management.md D6.
Fix: restore the current requests, replies and codes in every row, or declare each rename under Client-visible changes and update mcp-management.md, mcp-apps.md, TemporaryMcp.md, the CLI and the Web client in the same change.
P2-3 (round 3 P2-2). PluginManager list, replies and Errors columns still disagree with the code
Problem: PluginManager.md:124 says plugin.* keep their results and errors, but four parts still disagree. plugin.list merges status, waitingFor, error and refused into each item (crates/dim-app-server/src/plugin_manager.rs:2261-2275), and the row at PluginManager.md:76 omits them; the Web and CLI read them (web/src/rpc/general-settings.ts:95-113; crates/dim-cli/src/plugin_command.rs:199-225). Install, enable and reload do not reply the status map in the rows: install replies the loader status plus id, name, enabled, locked? and the optional outcomes (plugin_manager.rs:1362-1374), and enable and reload reply the status object plus optional outcomes (plugin_manager.rs:1502-1504,1667-1670). plugin.remove rejects ref (plugin_manager.rs:1206-1213), so {id, ref?} at line 82 is wrong. The Errors columns invent or omit codes: install lists not_updatable, not_removable and name_changed, which install never returns; enable lists not_reloadable and node_unavailable; reload lists plugin_locked, which reload never checks; remove lists plugin_locked, which remove never checks (plugin_manager.rs:1221-1455,1457-1504,1527-1670).
Failure: the Web plugin page decodes status, error and refused from plugin.list (web/src/features/settings/PluginSettings.vue:93-95); a daemon built from the row returns none of them, so every plugin renders as content-only with no failure text and content refusals vanish. A client that sends ref to remove gets invalid_params, and a client matching plugin_locked on reload waits for an error the daemon never sends.
Evidence: the handlers and decoders above; the Errors table at PluginManager.md:91-102 and the mapping at line 172.
Fix: add the status fields to the list item and the operation replies, make remove {id}, and make each Errors column equal the codes its handler returns.
P2-4 (round 3 P2-3). Skills rows, codes and token text still disagree
Problem: skills.catalog still says {project?} to {skills, projects, invalid}, but the handler takes {cwd?} and replies {version, entries, issues} (crates/dim-app-server/src/skills_management.rs:299-303,684-718). skills.set_enabled says {id, enabled, project?} to {}, while the code takes {cwd?, id, enabled} and replies {version} (skills_management.rs:270-278,305-307,720-733). skills.refresh says {} to {generation}, while the code takes {cwd?} and replies {version, issues} (skills_management.rs:305-310,735-751). The update and remove rows use missing, unmanaged, conflict, write_failed and delete_failed, while the code returns skills_install_unknown, skills_install_unmanaged, skills_conflict, skills_write_failed, skills_selection_invalid, skills_install_conflict, skills_install_failed and skills_remove_failed (crates/dim-agent-capabilities/src/skills/mod.rs:350-361; skills_management.rs:828-868). The install row says {source, id, skills, overwrite} while id is optional (skills_management.rs:337-345; retained section at Skills.md:291), and it omits skills_selection_invalid, skills_install_conflict and skills_install_failed. The preview row names skills_invalid_source, skills_fetch_failed and skills_too_large, which do not exist, while the boundary returns skills_source_invalid and skills_acquire_failed (skills_management.rs:483-499). The token text also survives at Skills.md:141,154,169,177,210.
Failure: the Web Skills page decodes {version, entries, issues} (web/src/rpc/general-settings.ts:80-90); a daemon built from the catalog row returns no version, so the page shows no Skills. The CLI calls skills.catalog, skills.set_enabled and skills.refresh with {cwd} (crates/dim-cli/src/management/skills.rs:78-110), which the rows do not describe. A client keyed on missing or delete_failed does not recognize the daemon's skills_install_unknown or skills_remove_failed.
Evidence: the handlers and enums above; the Errors table at Skills.md:117-133 does not match the rows.
Fix: use the current catalog, set_enabled and refresh requests and replies, use the current codes in preview, install, update and remove, mark id?, and delete the token text from Flows, Exceptions, Rule check and the appendix.
P2-5 (round 3 P2-4). Hooks still asserts an agent-crate port that the target deletes
Problem: Hooks.md:153 says the Session part reads the Settings source through the port, line 166 calls the port a host binding, and line 167 says the agent crate uses the port. Lines 15 and 17 say there is no agent-crate port and the port is removed, line 104 deletes SettingsHookSources, Supersedes at line 217 replaces HookSourcesHost, and docs/design/contracts/resource-owner-operations.md:139 says the port is removed.
Failure: an implementer cannot tell whether a Session port survives. Keeping one contradicts the one-reader decision and reintroduces the two-reader design this PR removes.
Evidence: Hooks.md:15,17,104,153,166,167,217; resource-owner-operations.md:139.
Fix: say HooksSession and HooksBranch read through hooksService.sources in both Rule check rows, and delete the port clauses at lines 153, 166 and 167.
P2-6 (round 3 P2-5). PluginManager still has no install or update flow
Problem: sections 2.1 to 2.3 define the manifest, plugins.json and the default configuration file, not the install or update steps. The old section 3.2 Install and section 3.5 Update are a one-line stub and absent (PluginManager.md:373), while lines 206, 274 and 324 still point at the install/update behavior in §2.1-§2.3. Line 9 still says install, update and remove behavior stays as this document describes. docs/design/plugins/LightOcr.md:5,53,140, RuntimeManager.md:83,150,171 and the open #2094 PluginManager edit still rely on the removed sections.
Failure: PluginManager, LightOcr and RuntimeManager have no normative install or update sequence to implement, and a reader who follows the new pointer finds no steps. The document asserts unchanged behavior while deleting its description.
Evidence: PluginManager.md:9,206,274,324,373; the section 2.1 to 2.3 headings at lines 180, 238 and 307.
Fix: keep section 3.2 and section 3.5, or move their steps into a target install/update flow section, point the three references at that section, and make line 9 match what remains.
Prior opinions
None withdrawn. Round 3 P2-1 through P2-5 are unchanged and still hold at 18d5e4f. Round 3 P2-6 is not withdrawn: the delta adds kind-to-code pairs, but four are false and several kinds are unmapped (P2-1 above), and the appendix lines Mcp.md:238 and PluginManager.md:172 still describe a different code set from the Errors tables. The round 3 P3 items (nonexistent type names, stale anchors and requirement numbers) remain optional and unchanged.
Cross-PR note
Current heads checked: #2102 3b48e12, #2100 437266b, #2103 59a77a3, #2098 c3acab3, #2097 ed43cd9, and #2094 0677c71 (moved since the prior round). The target names #2101 references still agree: Permission.advise and Approval.decide in #2100, Prompt configure in #2102's PromptSourcesBranch, and SessionMethods.register and ToolRegistry.register in #2103.
Merge-order risk is concrete. git merge-tree between 18d5e4f and the current heads reports conflicts with #2100 in docs/design/plugins/Hooks.md, docs/design/plugins/README.md and docs/design/service-faces.md; with #2094 in docs/design/contracts/resource-owner-operations.md and plugins/README.md; and with #2102, #2103 and #2098 in plugins/README.md. #2097 merges clean. #2100's Hooks.md still defines a HookSources Session port, which contradicts #2101's no-port decision; #2101's one-reader contract has to win when the two merge. #2094's PluginManager.md still relies on the section 3.2 install behavior that #2101 deletes, which worsens P2-6. #2103 is CONFLICTING against main; #2101 is MERGEABLE against main.
Checks
LC_ALL=en_US.UTF-8 node scripts/adr-check.mjs --base 5a279d6988c80692a77f3438fff4d26f7875e4c9 passes on 18d5e4f (ADR freeze passed: 12 changed files). A repository-wide link and anchor check found 6771 links and 46 bad ones; only one is in a changed file (PluginManager.md:223 to client-ui-extensions.md#附录-a-manifest-绑定), and the same link exists on origin/main (PluginManager.md:98), so it is pre-existing. CI on 18d5e4f: changes and ci-ok pass; acp-registry, dependencies, macos-native, scripts, static-checks, web, windows-cli and verify are skipped for this documentation-only diff. I did not run the Rust test suite. The Desktop client is not in this repository, so its use of the changed MCP fields is inferred from the Web and CLI call sites.
|
|
||
| ## Client-visible changes | ||
|
|
||
| None. `mcp.inspect` keeps `{cwd?, id, source}` and `{enabled, configuration, connections}`, now re-sourced from the report registry; `mcp.catalog`, `mcpSession.state`, `session.mcp_temporary.attach`, `mcp.import.sources` and `mcp.temporary.capabilities` keep their current requests, replies and codes. Internal kinds map onto the codes clients already receive: `mount_failed` is `mcp_binding_failed`, `invalid` is `invalid_params` where the method answered it before, and `missing` is the existing not-found code of each method. The removed `mcpSession.subscribe` is Rust-only and never crossed the client protocol. |
There was a problem hiding this comment.
Problem: the new mapping is incomplete and its claims do not hold. missing has no per-method not-found code: an unknown entry answers mcp_unknown_server (crates/dim-app-server/src/mcp/management.rs:512; retained docs/design/appserver/mcp-management.md:790) and an empty id answers mcp_invalid_config (crates/dim-app-server/src/mcp.rs:838-839; management.rs:510); only the temporary binding answers mcp_binding_missing (crates/dim-app-server/src/mcp/temporary.rs:86-92). invalid is invalid_params only for decode failures: mcp.auth.complete answers mcp_auth_callback_invalid or mcp_auth_attempt_closed (crates/dim-app-server/src/mcp/auth.rs:51-62), and an empty id answers mcp_invalid_config. The kinds conflict, settings_write, settings_conflict and user_scope are left unmapped even though the current codes are mcp_settings_conflict, mcp_move_conflict, mcp_import_conflict, mcp_settings_read and mcp_credentials_are_user_scoped (management.rs:505-528), and settings_write has no current code at all: the content face routes every error through management::error (crates/dim-app-server/src/mcp/face.rs:84-95).
Failure: an implementation that follows the paragraph either publishes missing, conflict, settings_write or user_scope, which clients matching mcp_unknown_server, mcp_settings_conflict or mcp_credentials_are_user_scoped do not recognize, or it invents a conversion the contract does not define. The None claim above cannot hold either way.
Fix: give one complete table per family (management, temporary, mcpService, mcpSession) with each internal kind and the exact current code, state that the management-methods boundary performs the conversion, or name the serialized variants after the wire codes, and make the Errors table's Kind column the internal set only.
| | `mcp.auth.logout` | Remove an entry's OAuth records | `{id, project?}` | `{}` | Accepted write is not cancelled | `missing`, `user_scope`, `closed` | | ||
| | `mcpSession.state` | The Session's MCP view | `{}` | `{servers, catalogError, closed}` | None; the value is read | `closed` | | ||
| | `mcpSession.refresh` | Ask the owner to rediscover the enabled entries | `{}` | `{}` | None; the signal is a value | `closed` | | ||
| | `mcpSession.widget` | The view for one published tool | `{publishedTool}` | `{view}` or absent | The client dropping the call cancels the read | `absent`, `unsupported`, `not_callable`, `unknown_server`, `unavailable`, `refused`, `unknown`, `closed` | |
There was a problem hiding this comment.
Problem: these kind names are not the codes current clients receive. session.mcp.app.widget and .call publish mcp_app_absent, mcp_app_unsupported, mcp_app_not_callable, mcp_unknown_server, mcp_unavailable, mcp_app_refused and mcp_app_unknown (crates/dim-app-server/src/connection/mcp.rs:41-50), so none of the seven matches the bare names in this row. The new mapping at Mcp.md:178 does not map them, and the note that they match McpAppError's existing serde names is about the Rust enum, not the wire: the prefix is applied at the connection boundary.
Failure: a client built from these rows matches absent or refused and never sees mcp_app_absent or mcp_app_refused, while Client-visible changes says None.
Fix: list the current mcp_app_* codes in both rows and in the Errors table, or add these kinds to the mapping with their current codes and say where the conversion happens.
|
|
||
| ### Client-visible changes | ||
|
|
||
| None. `plugin.*` and the `plugin` tool keep their commands, results and errors; the `Manager` handoff was a Session-part implementation detail. The owner's kinds map onto the codes clients receive today: `exists` is `plugin_exists`, `missing` is `plugin_not_found`, `load_failed` and `restart_required` are `acquire_failed`, `content_refused` is `refused`, `write_failed` is `record_unreadable`, `usage` is `invalid_params`, and `invalid_source`, `invalid_manifest`, `invalid_id`, `path_outside_plugins`, `plugin_locked` and `invalid_params` keep their names. |
There was a problem hiding this comment.
Problem: four pairs are wrong and the paragraph disagrees with the wire and with line 172. There is no refused error code: content refusals are the refused reply array (crates/dim-app-server/src/plugin_manager.rs:628-650,2261-2275; crates/dim-app-server/src/plugin_manager/management.rs:83,113). A failed plugins.json write is acquire_failed (plugin_manager.rs:1168-1170), while record_unreadable is a read error (crates/dim-app-server/src/plugin_manager/record.rs:226; PluginManager.md:287-305). restart_required is the restartRequired outcome flag (plugin_manager.rs:628-650), and a load failure is status: "failed" plus error (plugin_manager.rs:2297-2310), not acquire_failed. usage is the plugin tool's usage text result (crates/dim-app-server/src/plugin_manager/tools.rs:355-360), not an RPC code. Line 172 still lists a different set: it has not_updatable, not_removable, not_reloadable, name_changed, optional_not_found, node_unavailable and dependencies_failed, and it lacks refused and record_unreadable.
Failure: a client that matches record_unreadable for a failed write waits for a code the daemon never sends, and a daemon built from this paragraph introduces refused and record_unreadable errors while dropping seven codes that line 172 says clients receive.
Fix: delete the false pairs, list the current codes once (invalid_params, invalid_source, invalid_id, invalid_manifest, path_outside_plugins, plugin_exists, plugin_not_found, plugin_locked, not_updatable, not_removable, not_reloadable, name_changed, acquire_failed, optional_not_found, node_unavailable, dependencies_failed, record_unreadable), state where the kind-to-code conversion happens, and merge line 172 into the same list.
|
Closing as part of abandoning the owner-split experiment. |
Design part for the #2022 content owners: MCP, Hooks, Skills and PluginManager. The contracts define the public operations, errors, flows, exceptions, rule checks and binding appendices; the existing feature designs stay below each target contract.
Refs #2022. Refs #2015.
Delivery comment on #2022: #2022 (comment)
Merge order
#2029 → #2080 → #2091/#2092/#2093 → #2094 → #2096 → the rest.
Sibling heads this change is aligned with: #2098
c3acab356, #210359a77a3d1. A paragraph that depends on a sibling names that PR; its head is the one above.