Repository navigation
Conversation
Add the target contracts for Settings, its client namespace and the settings section owners under design rules §7. The Settings contract replaces the settingsService owner API and the settings facade with one service: register returns a source id, owners read a document as a value and change it through a callback that the owner runs under its exclusion, user edits carry the draft revision, the agent reads a redacted document and sets one member, and the authorized-project table is a value plus one admission operation. workflowFiles, commandRules and the three prompt host names are removed; the workflow definition files, the command rules value and the prompt texts are requested from their owners. Requirements raised to SessionStore, Provider and Workflow are stated in the Settings contract. Refs #2017 Refs #2015
Write the owner contracts for the model and provider board under design rules §7: the responsibility split, the caller compositions, the operations with their cancellation and error kinds, the flows that settle each resource, the exceptions, the rule check and the Rust bindings. Provider becomes the single model owner of the product profile: resolution, preference application, selection listing, temporary startup admissions, request execution, media routes and one-call leases. It owns the driver, so credentials never leave the owner and no connection crosses. ConfiguredModels answers the same `providerService` operations from the model file. Account owners share one contract: availability and its subscription, the account catalog, one-request leases with an id, one controlled recovery and settlement, plus the Dim relay's search and title. The ChatGPT account remains; the ManagedProviders host binding and the `managedSearch` face are retired, so no owner returns another owner's data. ModelLog and the provider document stay with the Settings board (#2094); the driver reads ModelLog's recording value. Refs #2019 · Refs #2015
Write the owner contracts for the model and provider board under design rules §7: the responsibility split, the caller compositions, the operations with their cancellation and error kinds, the flows that settle each resource, the exceptions, the rule check and the Rust bindings. Provider becomes the single model owner of the product profile: resolution, preference application, selection listing, temporary startup admissions, request execution, media routes and one-call leases. It owns the driver, so credentials never leave the owner and no connection crosses. ConfiguredModels answers the same `providerService` operations from the model file. Account owners share one contract: availability and its subscription, the account catalog, one-request leases with an id, one controlled recovery and settlement, plus the Dim relay's search and title. The ChatGPT account remains; the ManagedProviders host binding and the `managedSearch` face are retired, so no owner returns another owner's data. ModelLog and the provider document stay with the Settings board (#2094); the driver reads ModelLog's recording value. Refs #2019 · Refs #2015
Write the owner contracts for the model and provider board under design rules §7: the responsibility split, the caller compositions, the operations with their cancellation and error kinds, the flows that settle each resource, the exceptions, the rule check and the Rust bindings. Provider becomes the single model owner of the product profile: resolution, preference application, selection listing, temporary startup admissions, request execution, media routes and one-call leases. It owns the driver, so credentials never leave the owner and no connection crosses. ConfiguredModels answers the same `providerService` operations from the model file. Account owners share one contract: availability and its subscription, the account catalog, one-request leases with an id, one controlled recovery and settlement, plus the Dim relay's search and title. The ChatGPT account remains; the ManagedProviders host binding and the `managedSearch` face are retired, so no owner returns another owner's data. ModelLog and the provider document stay with the Settings board (#2094); the driver reads ModelLog's recording value. Refs #2019 · Refs #2015
Write the owner contracts for the model and provider board under design rules §7: the responsibility split, the caller compositions, the operations with their cancellation and error kinds, the flows that settle each resource, the exceptions, the rule check and the Rust bindings. Provider becomes the single model owner of the product profile: resolution, preference application, selection listing, temporary startup admissions, request execution, media routes and one-call leases. It owns the driver, so credentials never leave the owner and no connection crosses. ConfiguredModels answers the same `providerService` operations from the model file. Account owners share one contract: availability and its subscription, the account catalog, one-request leases with an id, one controlled recovery and settlement, plus the Dim relay's search and title. The ChatGPT account remains; the ManagedProviders host binding and the `managedSearch` face are retired, so no owner returns another owner's data. ModelLog and the provider document stay with the Settings board (#2094); the driver reads ModelLog's recording value. Refs #2019 · Refs #2015
The user's revision is the draft base the client holds, business concurrency control between the user's read and write. State that in the responsibility split, keep it out of the owner-path caller examples, and point the client example at SettingsMethods.
Write the owner contracts for the model and provider board under design rules §7: the responsibility split, the caller compositions, the operations with their cancellation and error kinds, the flows that settle each resource, the exceptions, the rule check and the Rust bindings. Provider becomes the single model owner of the product profile: resolution, preference application, selection listing, temporary startup admissions, request execution, media routes and one-attempt credentials. It owns the driver, so credentials never leave the owner and no connection crosses. ConfiguredModels answers the same `providerService` operations from the model file. Account owners share one contract: availability and its subscription, the account catalog, and one `with_lease` operation that hands the lease to the caller's attempt, recovers once and settles the lease itself, so no caller holds a lease id. DimOAuth adds relay search and title. The ChatGPT account remains; the ManagedProviders host binding and the `managedSearch` face are retired, so no owner returns another owner's data. ModelLog and the provider document stay with the Settings board (#2094); the driver reads ModelLog's recording value. Refs #2019 · Refs #2015
Consumers that read commandRules call permissionRules.rules; the delivery migration names the register operation, not its Rust helper.
Write the owner contracts for the model and provider board under design rules §7: the responsibility split, the caller compositions, the operations with their cancellation and error kinds, the flows that settle each resource, the exceptions, the rule check and the Rust bindings. Provider becomes the single model owner of the product profile: resolution, preference application, selection listing, temporary startup admissions, request execution, media routes and one-attempt credentials. It owns the driver, so credentials never leave the owner and no connection crosses. ConfiguredModels answers the same `providerService` operations from the model file. Account owners share one contract: availability and its subscription, the account catalog, and one `with_lease` operation that hands the lease to the caller's attempt, recovers once and settles the lease itself, so no caller holds a lease id. DimOAuth adds relay search and title. The ChatGPT account remains; the ManagedProviders host binding and the `managedSearch` face are retired, so no owner returns another owner's data. ModelLog and the provider document stay with the Settings board (#2094); the driver reads ModelLog's recording value. Refs #2019 · Refs #2015
Write the owner contracts for the model and provider board under design rules §7: the responsibility split, the caller compositions, the operations with their cancellation and error kinds, the flows that settle each resource, the exceptions, the rule check and the Rust bindings. Provider becomes the single model owner of the product profile: resolution, preference application, selection listing, temporary startup admissions, request execution, media routes and one-attempt credentials. It owns the driver, so credentials never leave the owner and no connection crosses. ConfiguredModels answers the same `providerService` operations from the model file. Account owners share one contract: availability and its subscription, the account catalog, and one `with_lease` operation that hands the lease to the caller's attempt, recovers once and settles the lease itself, so no caller holds a lease id. DimOAuth adds relay search and title. The ChatGPT account remains; the ManagedProviders host binding and the `managedSearch` face are retired, so no owner returns another owner's data. ModelLog and the provider document stay with the Settings board (#2094); the driver reads ModelLog's recording value. Refs #2019 · Refs #2015
|
评审(head
|
The native profile's row operations (readUser, importUserIfAbsent, changeUser, replaceUser) belong to the Settings contract; the storage engine executes them as crate-private transactions and its public face keeps only storageReport and the offline operations. The client examples use typed requests instead of inline JSON literals.
|
已按评审修改,head
|
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: this PR adds nine owner contracts under docs/design/plugins/ for Settings and the settings sections (SettingsMethods, PromptSettings, ExecutionSettings, PromptSuggestionSettings, ProviderSettings, ModelLog, PermissionRules, CollaborationModelPolicy) and adds their rows to the plugin README, as part of the owner scan for #2017 and #2015 under the section 7 owner rules tracked by #2029.
Verdict: REQUEST_CHANGES
P1
1. Settings.md:120: register cannot declare user-only members.
Problem: the request is {source, userFile, projectFile?, schema}; neither it nor the Data section names a user-only pointer list, yet the Authority rule, the user_only error of change, and the refusal in agent_set all depend on one. Every current declaration carries userOnly (docs/design/appserver/settings-service.md section 3.1; docs/design/plugins/PluginManager.md:370; crates/dim-app-server/src/settings/declared.rs:19-21), including /userAgent in crates/dim-app-server/src/provider_settings.rs:43, /base, /summary and /skills in crates/dim-app-server/src/prompt_settings.rs:123, and /projectEnabled in runtime/plugins/workflow/settings.ts:6-8.
Failure scenario: an implementation of the new register cannot distinguish user-only members, so an owner or agent write changes them, or the user_only error is never produced; the existing sources would have to drop their declared rule.
Fix: add userOnly to the operation, the Data section, the wire declaration and both Rust bindings (register and the typed registration), and keep the check that each pointer names a reachable member.
2. SettingsMethods.md:12 and SettingsMethods.md:76: existing client callers break and are missing from the delivery.
Problem: the new methods drop scope from the requests, return only {revision} from settings.update, and say they are never served to a remote entry. Production callers outside the CLI use the old shape: the Web settings pages send scope: "user" and parse {revision, document} from the update reply (web/src/features/settings/DiagnosticsSettings.vue:33,46; web/src/features/settings/PermissionsSettings.vue:62,101; web/src/rpc/general-settings.ts:287-297), and the Web entry is allowlisted for model-log and execution (crates/dim-app-server/src/protocol.rs:313; crates/dim-app-server/tests/transport_flow/settings_methods.rs:503-506). The CLI does the same (crates/dim-cli/src/recording.rs:56-73; crates/dim-cli/src/prompt_command.rs:55-85). The delivery caller table lists only the CLI.
Failure scenario: the Web Diagnostics and Permissions pages fail on an unknown scope field or a missing document in the update reply; if the local-only sentence is read literally, both pages get unknown_method. The CLI update callers also lose the document they print.
Fix: keep {revision, document} or state the re-read and migrate the Web and CLI callers; state which entries are admitted (paired devices no, the authenticated loopback Web entry for its allowlisted sources yes); add the Web row to the delivery migration.
3. Settings.md:123: read_user and replace_user erase the declared-only boundary.
Problem: both operations address a document by source name and the contract does not restrict the client path to declared sources. docs/design/appserver/settings-service.md sections 4.3 and 8.1 say the opposite: settings.* serves declared sources only, and a Rust source such as mcp is settings_unknown_source (crates/dim-app-server/src/settings/declared.rs:185-208; crates/dim-app-server/src/settings_methods.rs:158). The target also needs read_user for Rust owners (PermissionRules, CollaborationModelPolicy, SkillsCatalog), so the operation itself serves them.
Failure scenario: a local client calls settings.read for mcp-secrets or mcp and receives documents the old contract withheld; replacing one bypasses the owner's namespace and validation. The SettingsMethods claim that the client never learns another owner's document is false.
Fix: bind these operations to a registered source id, or enforce the declared-only rule in SettingsMethods and give Rust owners a source-id path; state the rule in SettingsMethods.
4. Settings.md:135 and Settings.md:158: the project id type and the settings/projects fact contradict the current event and contract.
Problem: the Data section makes ProjectId a string and the Facts table emits {project, cwd}, while the current event is ProjectAuthorized { root: usize, cwd } on the same channel (crates/dim-app-server/src/settings.rs:109-127) and the scope is SettingsScope::Project(usize) (crates/dim-agent-capabilities/src/settings.rs:11-18). Line 5 says the events stay as settings-service.md describes, which is {root: number, cwd} and {"project": <root>} (sections 4.1 and 4.4).
Failure scenario: a listener that reads root receives no value, and a project scope sent as a number no longer decodes; the document claims no event change while changing the payload and the id type.
Fix: either keep the process-local number, or state explicitly that this also replaces sections 4.1 and 4.4, name the new string id, and update every listener and the delivery migration. FileStorage's target RootId is a string in #2080, so the string choice can be right, but the settings event and the old contract still say otherwise.
P2
5. Settings.md:173 and Settings.md:191: unsynced does not make a repeated change idempotent.
Problem: ChangeFn is an arbitrary Fn(Option<Document>) with no idempotence requirement; a change that appends or increments applies twice. The old contract says read before retrying (docs/design/appserver/settings-service.md section 6).
Failure scenario: a change that appends a command rule commits but reports unsynced; the caller repeats it as documented and the rule is added twice.
Fix: say the caller must read after unsynced and must not repeat a change without reading; remove the idempotence claim.
6. Settings.md:166: the public error list has no storage or persistence kind.
Problem: read, change, replace_user and authorize_project call FileStorage and the native rows; the row operations list storage (lines 146-149), and today SettingsError has Storage, Persistence and Worker (crates/dim-app-server/src/settings.rs:30-66). FileStorage's read and update can also return invalid, missing_parent, too_large, rejected, unsynced, closed and cancelled.
Failure scenario: an unreadable file or a failed SQLite transaction has no documented kind or next action; a client cannot tell a repair from a retry.
Fix: add a failed or storage kind and the FileStorage kinds the public operations propagate, and map the row and FileStorage errors.
7. Settings.md:184 and Settings.md:193: the project table cannot survive the next generation as written.
Problem: the flows and exceptions say the table survives and a project id stays valid, but the delivery plan deletes the project_roots seed loop (crates/dim-app-server/src/settings.rs:606-611), and FileStorage has no operation that enumerates the root table: add_root and root_path address one root (PR #2080).
Failure scenario: after Settings reloads, authorized_projects is empty, retained project ids do not resolve, and project-scoped reads fail until every cwd is authorized again. The delivery acceptance requires the same project id after a reload.
Fix: keep a seed source, add a FileStorage roots read, or persist the table; or state that Settings does not reload independently and remove the flow row.
8. Settings.md:151: FileStorage's update does not compare the revision.
Problem: the line says replace_user is FileStorage's update, "which compares the revision Settings carries". FileStorage's update has no version or digest parameter; its own target contract says the document revision is checked inside the caller's change helper (PR #2080, FileStorage.md caller example).
Failure scenario: an implementer relies on FileStorage for the expected revision and a stale user draft overwrites a concurrent write; no conflict is reported.
Fix: say that Settings reads the current revision and compares expectedRevision inside the update callback; FileStorage only holds the file key.
9. All service appendices: error enums do not derive Serialize, so the documented codes are not produced.
Problem: under rutis 0.23 an error that is not Serialize gets its code from the Debug identifier, so Invalid stays Invalid and Rejected { code, message } becomes Rejected, losing the change's own code. The current faces derive Serialize with #[serde(tag = "code", rename_all = "snake_case")] (crates/dim-agent-capabilities/src/execution_settings.rs:26-33; crates/dim-agent-capabilities/src/prompt_suggestion.rs:78-84).
Failure scenario: every documented lowercase kind (failed, invalid, unknown_source, cancelled, rejected) reaches the wire in a different case, and a rejected change's business code is lost.
Fix: derive Serialize with the same tag on every error enum in these appendices (Settings, PromptSettings, ExecutionSettings, PromptSuggestionSettings, ProviderSettings, ModelLog, PermissionRules, CollaborationModelPolicy).
10. Settings.md:268 and Settings.md:301: the change callback cannot cross languages as written.
Problem: the callback sits inside the Change request struct. A rutis method parameter must be DeserializeOwned, and a struct containing ChangeFn cannot be deserialized; a callback crosses as a top-level function parameter. Rejected also lacks From<rutis::host::CallError>, which FromFunction requires for the callback error (rutis 0.23 service.rs).
Failure scenario: the appendix does not compile, or change is not reachable from TypeScript or Python callers while the contract claims every operation is cross-language.
Fix: pass the callback as a positional ChangeFn parameter, as FileStorage's update does, and add impl From<rutis::host::CallError> for Rejected.
11. Settings.md:256: the Scope serde shape does not match the documented wire shape.
Problem: an externally tagged struct variant Project { project: ProjectId } serializes as {"project":{"project":"..."}}, not {"project": ProjectId} as the Data section says. The current SettingsScope::Project(usize) is a newtype variant and produces {"project":1}.
Failure scenario: a project scope built from the table does not decode, and the wire shape differs from the contract.
Fix: use Project(ProjectId) or a custom serde representation.
12. Settings.md:125: agent_read says it withholds user-only secrets.
Problem: the Authority line and the Data section say only writeOnly members are withheld from the agent; user-only is a write rule. ExecutionSettings makes the switches user-only and its Session tool reads them through the same path (docs/design/plugins/ExecutionSettings.md:23).
Failure scenario: an implementation that hides user-only members removes non-secret values such as sandbox and network from the agent's settings tool, contradicting ExecutionSettings and AgentSettings.
Fix: say "writeOnly members withheld" in the intent.
13. PromptSettings.md:5: the one-service contract contradicts the linked feature design.
Problem: docs/design/appserver/prompt-overrides.md section 3.1 still defines three data services with different operation names and bare string or null replies (basePromptSettingsHost.base, skillsInstructionsSettingsHost.instructions, summaryPromptSettingsHost.systemPrompt). The one-service {text} wrapper is a different wire shape.
Failure scenario: a TypeScript consumer or an implementation following the feature design calls names and shapes that the new contract deletes; readers cannot tell which document is authoritative.
Fix: mark that section superseded or update it in this PR, and add it to the delivery list.
14. ExecutionSettings.md:86, PromptSettings.md:87, PromptSuggestionSettings.md:86: no port type is defined for consumers outside the App Server.
Problem: the rule checks say consumers depend on the port type, not the App Server, but the appendices mark the service on the owner type that depends on Settings and define no port type. HostPlatform, PromptSources, Skills, ContextCompaction, Provider and aimux's recorder live outside dim-app-server (crates/dim-agent-capabilities/src/host_platform.rs:7; crates/dim-agent-capabilities/src/execution_settings.rs:43-87; crates/dim-agent-capabilities/src/prompt_sources.rs:381-390; crates/dim-agent-capabilities/src/prompt_suggestion.rs:97-137).
Failure scenario: the typed calls in the caller examples require a dependency on the App Server owner, violating ADR 002 D3, or the implementation needs an undeclared shared type.
Fix: name the crate and type of each service or keep a capability-side port type; state how a consumer outside the App Server reaches the operation.
15. SettingsMethods.md:84: invalid params omits a schema-invalid draft.
Problem: the table names only "a document that is not an object". A schema violation is also a caller error: settings-service.md section 6 maps invalid_document to invalid params on the client path, and the current wire maps Document and DocumentShape to invalid (crates/dim-app-server/src/settings_methods.rs:98-104).
Failure scenario: an out-of-range maxChars or an unknown member falls into settings_failed, whose guidance is read again, not fix the draft; the client cannot show the validator message as an input error.
Fix: list invalid_document under invalid params, with the message.
16. Settings.md:112 and Settings.md:193: the FileStorage links are forward references.
Problem: both links point at docs/design/plugins/FileStorage.md, which does not exist at this head; it is added by open PR #2080.
Failure scenario: after this PR merges before #2080, both links are 404 and the dependency cannot be read.
Fix: link PR #2080 or merge after it.
17. Settings.md:299 and Settings.md:320: the binding appendix is not self-contained and does not compile.
Problem: Register, Read, Change, ReadUser, ReplaceUser, SetMember, ByInstance, Declarations, AuthorizeProject, Authorized, AuthorizedProjects, Snapshot, UserSnapshot and AgentSnapshot are used but not defined. register returns Registered while the caller example at line 48 uses the result as a SourceId. authorized_projects is declared sync returning AuthorizedProjects while the operations table gives it a closed error.
Failure scenario: the appendix cannot compile and an implementer must invent the request and reply shapes; the closed error has no return path.
Fix: define each type, make register return SourceId or use .id in the example, and return a Result from authorized_projects or drop its closed error.
P3
18. ExecutionSettings.md:11 and ExecutionSettings.md:92: the user-only change is presented as a rename.
Problem: the contract makes both switches user-only, but line 92 says only the service name changes and the delivery table lists only the rename. The current source declares user_only: Vec::new() (crates/dim-app-server/src/execution_settings.rs:45-60).
Failure scenario: an implementation following the delivery leaves owner and agent writes allowed, so the stated authority rule is false; or a write that used to succeed returns user_only without a migration entry.
Fix: state the authority change and add userOnly to the declaration and the delivery list, or drop the claim.
19. PermissionRules.md:71 and CollaborationModelPolicy.md:54: the client paths omit operation_interrupted.
Problem: the current owners map SettingsError::Cancelled to operation_interrupted (crates/dim-app-server/src/permission_rules.rs:129-134; crates/dim-app-server/src/collaboration_model_policy.rs:85-92), and the linked designs say cancellation is operation_interrupted (docs/design/appserver/permission-command-rules.md:282; docs/design/subagent-model-policy.md:143).
Failure scenario: a call interrupted by owner unload returns an undocumented code.
Fix: add the kind, or state that cancellation has no reply and remove the server mapping.
20. SettingsMethods.md:23 and SettingsMethods.md:117: the caller counts and the migration scope are understated.
Problem: the CLI reads five settings sources, not four (crates/dim-cli/src/prompt_command.rs:13; crates/dim-cli/src/recording.rs:8; crates/dim-cli/src/session_host.rs:1719,1828,1861; crates/dim-cli/src/management/workflow.rs:26); the Web pages call settings.read and settings.update; and the Workflow TypeScript plugin calls settings.projects (runtime/plugins/workflow/catalog.ts:35), which the delivery table already includes.
Failure scenario: the justification for deleting settings.sources and the migration scope are both incomplete.
Fix: state the real source count and list every caller, including the Web entry and Workflow.
21. SettingsMethods.md:96: the update flow contradicts its own cancellation rule.
Problem: the method table says a cancelled call is dropped (line 76), but the flow says a cancelled call ends settings_failed or reloading; Settings replace_user lists cancelled separately.
Failure scenario: clients cannot tell whether a cancelled write produced a reply.
Fix: use one cancellation rule for the namespace.
|
|
||
| | Operation | Intent | Request | Reply | Cancellation | Errors | | ||
| | --- | --- | --- | --- | --- | --- | | ||
| | `register` | Make a document addressable under the calling row, checked once | `{source, userFile, projectFile?, schema}` | `{id}` | None; a refusal fails the row's `apply` | `invalid` | |
There was a problem hiding this comment.
register cannot express user-only members: the request is {source, userFile, projectFile?, schema}, yet change must return user_only and agent_set must refuse those members. Every current declaration carries a user-only pointer list (docs/design/appserver/settings-service.md section 3.1; docs/design/plugins/PluginManager.md:370; crates/dim-app-server/src/settings/declared.rs:19-21), for example /userAgent in crates/dim-app-server/src/provider_settings.rs:43 and /base, /summary, /skills in crates/dim-app-server/src/prompt_settings.rs:123. Without the field the authority rule and the user_only error are unreachable. Add userOnly to the operation, the Data section and both Rust bindings.
There was a problem hiding this comment.
Fixed in be0b517: userOnly is in the register request, the Data section, the wire declaration and both bindings (Settings.md:125,141,273,537).
| | `register` | Make a document addressable under the calling row, checked once | `{source, userFile, projectFile?, schema}` | `{id}` | None; a refusal fails the row's `apply` | `invalid` | | ||
| | `read` | The document a source id names, as stored now | `{id, scope}` | `{document}` | While the document is read | `invalid`, `invalid_document`, `too_large`, `closed`, `cancelled` | | ||
| | `change` | Apply one change to a document under the owner's exclusion | `{id, scope, change}` | `{}` | Before the write; the change's future is dropped | `invalid`, `invalid_document`, `user_only`, `rejected`, `too_large`, `unsynced`, `closed`, `cancelled` | | ||
| | `read_user` | The user's draft base for a document | `{source}` | `{revision, document}` | While the document is read | `unknown_source`, `invalid_document`, `too_large`, `closed`, `cancelled` | |
There was a problem hiding this comment.
read_user and replace_user address a document by source name and no longer restrict the client path to declared sources. docs/design/appserver/settings-service.md sections 4.3 and 8.1 say the opposite: settings.* serves declared sources only and a Rust source such as mcp is settings_unknown_source (crates/dim-app-server/src/settings/declared.rs:185-208). The target also needs these operations for Rust owners, so a local client could read mcp-secrets directly through settings.read. Bind the operations to a registered source id, or enforce the declared-only rule in SettingsMethods and state it.
There was a problem hiding this comment.
Partially fixed in be0b517: read_user and replace_user take a source id and SettingsMethods enforces declared-only, but the new row binding says a cross-row id is invalid while SettingsMethods calls these operations across rows. Still open; see the new review.
| | `change` | Apply one change to a document under the owner's exclusion | `{id, scope, change}` | `{}` | Before the write; the change's future is dropped | `invalid`, `invalid_document`, `user_only`, `rejected`, `too_large`, `unsynced`, `closed`, `cancelled` | | ||
| | `read_user` | The user's draft base for a document | `{source}` | `{revision, document}` | While the document is read | `unknown_source`, `invalid_document`, `too_large`, `closed`, `cancelled` | | ||
| | `replace_user` | Replace a document with the draft the user edited at the revision read | `{source, expectedRevision, document}` | `{revision}` | Before the write | `unknown_source`, `invalid_document`, `conflict`, `too_large`, `unsynced`, `closed`, `cancelled` | | ||
| | `agent_read` | A document for the agent, user-only secrets withheld | `{source}` | `{document, writeOnly}` | While the document is read | `unknown_source`, `invalid_document`, `too_large`, `closed`, `cancelled` | |
There was a problem hiding this comment.
The intent says "user-only secrets withheld", but the Authority line and the Data section say only writeOnly members are withheld from the agent; user-only is a write rule. docs/design/plugins/ExecutionSettings.md:11,23 makes the execution switches user-only and exposes them to the agent's settings tool through this path. If agent_read hides user-only members, the tool loses sandbox and network. Say "writeOnly members withheld".
There was a problem hiding this comment.
Fixed in be0b517: agent_read withholds writeOnly members and the intent says so (Settings.md:130).
|
|
||
| - `SourceId` is the id `register` assigns; it is bound to the row that registered it, and a caller from another row is `invalid`. | ||
| - `Document` is one JSON object; a missing user document reads as its default document. | ||
| - `Scope` is `"user"` or `{"project": ProjectId}`. `ProjectId` is this process's project id; a project id from another process is not accepted. |
There was a problem hiding this comment.
ProjectId is a string here, while the current scope is SettingsScope::Project(usize) (crates/dim-agent-capabilities/src/settings.rs:11-18) and settings-service.md section 4.1 defines {"project": <root>} as a process-local number. Line 5 says this document replaces only sections 4.2-4.5, so section 4.1 remains authoritative. If the string id is intended, say that this also replaces section 4.1 and the event payloads; otherwise keep the number.
There was a problem hiding this comment.
Fixed in be0b517: the project id is a number and Scope::Project(ProjectId) serializes as {"project": number} (Settings.md:140,263,282-285).
| | `changeUser` | Apply one change under the row's exclusion | `{source, change}` | `{version, document}` | `rejected`, `storage` | | ||
| | `replaceUser` | Replace a user document at an expected version | `{source, expectedVersion, document}` | `{version}` | `conflict`, `missing`, `overflow`, `storage` | | ||
|
|
||
| `change` in the public operations is `changeUser` on the native profile and FileStorage's `update` on the file profile; `replace_user` is `replaceUser` and FileStorage's `update`, which compares the revision Settings carries. `importUserIfAbsent` runs on the first read of a source whose file exists and whose row does not; a version is a positive integer that increases on every committed write, and the revision Settings publishes is derived from it. |
There was a problem hiding this comment.
FileStorage's update has no version or digest parameter; its own target contract says the document revision is checked inside the caller's change helper (PR #2080, FileStorage.md caller example). As written, an implementer may expect FileStorage to compare expectedRevision and a stale user draft can overwrite a concurrent write without a conflict. Say that Settings reads and compares the revision inside the update callback.
There was a problem hiding this comment.
Fixed in be0b517: the file-profile revision is compared inside the FileStorage update callback (Settings.md:157).
|
|
||
| | Kind | What the caller does next | | ||
| | --- | --- | | ||
| | invalid params | Fix the request: an unknown field, a missing revision, or a document that is not an object | |
There was a problem hiding this comment.
invalid params names only a non-object document, but a schema violation on a client write is also a caller error: settings-service.md section 6 maps invalid_document to invalid params on the client path, and crates/dim-app-server/src/settings_methods.rs:98-104 maps Document and DocumentShape to invalid. Under the new mapping an out-of-range maxChars falls into settings_failed, whose guidance is read again, not fix the draft. List invalid_document under invalid params with the validator message.
There was a problem hiding this comment.
Fixed in be0b517: a schema refusal is invalid params with the validator message (SettingsMethods.md:88,96).
|
|
||
| Scope: process. Issue: [#2017](https://github.com/arcships/dim/issues/2017). Feature design: [Prompt overrides](../appserver/prompt-overrides.md). | ||
|
|
||
| PromptSettings owns the `prompts` document and the three model-facing texts it carries: the base identity and rules, the compaction summary prompt, and the Skills instructions. This document is the owner's target contract; it replaces the three `*PromptSettingsHost` services with one service. |
There was a problem hiding this comment.
This replaces the three ports, but the linked feature design still defines three services with different operation names and bare string or null replies (docs/design/appserver/prompt-overrides.md section 3.1: basePromptSettingsHost.base, skillsInstructionsSettingsHost.instructions, summaryPromptSettingsHost.systemPrompt). The one-service {text} wrapper is a different wire shape. Mark that section superseded or update it in this PR and add it to the delivery list.
There was a problem hiding this comment.
Fixed in be0b517: prompt-overrides.md §3.1 is superseded. Its §4 sentence about settings.sources is still stale; see the new review.
| PromptSources reads the base text once, while its Session part applies. | ||
|
|
||
| ```rust | ||
| let base = prompt_settings.base().await.ok().flatten(); |
There was a problem hiding this comment.
With the appendix, base() returns Result<Text, _>; .ok() gives Option<Text>, which has no flatten(), and factory.base.or(base) does not type-check against Option<Text>. The same pattern appears in ProviderSettings.md:32 and ModelLog.md:31-32. Make the examples unwrap Text.text or return the optional value directly.
There was a problem hiding this comment.
Still open in be0b517: the appendix returns PromptText, so .ok().flatten() does not type-check; ProviderSettings.md:32 and ModelLog.md:31 have the same pattern.
| | §7 caller complexity | Nothing of the source, its file or the user-only rule reaches the caller. | | ||
| | §7 one change | The name change and its callers migrate in the same change. | | ||
| | ADR 002 D1 | Process scope: the switch applies to the process, not a Session. | | ||
| | ADR 002 D3 | HostPlatform depends on the port; the port has no Settings or file dependency. | |
There was a problem hiding this comment.
The rule check says HostPlatform depends on the port type, but the appendix marks the service on the owner type that depends on Settings (line 42) and defines no port type. HostPlatform and the other consumers live in dim-agent-capabilities or aimux (crates/dim-agent-capabilities/src/host_platform.rs:7; crates/dim-agent-capabilities/src/execution_settings.rs:43-87), so a typed call to an App Server owner would violate ADR 002 D3. Name the crate and type of the service or keep a capability-side port. The same applies to PromptSettings.md:87 and PromptSuggestionSettings.md:86.
There was a problem hiding this comment.
Partially fixed in be0b517: the consumer ports are named, but ExecutionSettings.md:43 names ExecutionSettings while its appendix returns Switches. Still open.
There was a problem hiding this comment.
Fixed in fcf1dd5 (head 8ef2691). ExecutionSettings.md:43 names the port trait ExecutionSettingsRead and the reply type Switches, and the appendix defines both (ExecutionSettings.md:111-135). PromptSettings.md:45 names its three capability-side traits and PromptSuggestionSettings.md:43 names SuggestionSettings/PromptSuggestionSettingsRead.
|
|
||
| ## Requirements raised to mechanism owners | ||
|
|
||
| None new. HostPlatform's read at process preparation is unchanged in shape; only the service name changes. |
There was a problem hiding this comment.
The requirements say only the service name changes, but lines 11, 22 and 83 make the switches user-only. The current registration declares user_only: Vec::new() (crates/dim-app-server/src/execution_settings.rs:45-60), and the delivery table lists only the rename. State the authority change and add userOnly to the execution declaration and the delivery list, or drop the user-only claim.
There was a problem hiding this comment.
Fixed in be0b517: the execution authority change and its delivery entry are stated (ExecutionSettings.md:11).
Declare user-only members in the registration, keep the client methods' request
and reply shapes, serve declared sources only and resolve their ids, keep the
process-local project number and the {root, cwd} fact, and state the project
table's generation lifetime. Errors carry {code, message} with snake_case codes;
the change callback is a positional parameter and keeps the callback's code.
Name the capability-side ports, link FileStorage through its PR, and supersede
the paragraphs this board replaces in the existing design documents.
|
已按评审修改,head P1
P2
规则 A–G 的自查:错误序列化与回调参数按 A;错误表覆盖各流程的结束按 B;九份契约都加 Supersedes,被取代的段落已在本 PR 改成链接(settings-service §4.2/§4.5、§4.3→SettingsMethods、prompt-overrides §3.1、permission-command-rules §4.1、service-faces、resource-owner-operations §Settings、management-methods、subagent-model-policy、model-log、provider-management)按 C;客户端协议与用户可见行为不变,只有两个管理方法删除,单列 Client-visible changes 按 D;本板没有分页读,E 不适用;#2080 的链接用 PR URL、§7 链接指向 #2029 的标题、README By scope 随索引行更新、没有列出已关闭 issue 按 F;进程所有者不涉及按 id 直达内层,Rule check 里写明 ADR 027 不适用按 G。
|
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: this PR adds nine owner contracts under docs/design/plugins/ for Settings and the settings sections, updates the linked feature designs, and states the delivery for #2017 under the section 7 owner rules tracked by #2029 (refs #2017, #2015).
Verdict: REQUEST_CHANGES
Round-1 status
P1:
- Fixed.
userOnlyis in theregisterrequest, the Data section, the wire declaration and both bindings (Settings.md:125,141,273,537). - Fixed. The Web entry is admitted for
model-logandexecution, the request and reply shapes are kept, and the delivery lists the Web pages (SettingsMethods.md:13,28,71,118-120). - Partially fixed.
read_userandreplace_usernow take a source id andSettingsMethodsenforces the declared-only rule (Settings.md:128-129,SettingsMethods.md:5,12,77). The new row binding contradicts the client path (P2 4 below). - Fixed.
ProjectIdis a number,Scope::Project(ProjectId)is a newtype variant, and the facts carry{root, cwd}(Settings.md:140,164,263,282-285,204).
P2:
- Fixed.
unsyncednow says to read before repeating (Settings.md:179,197). - Fixed.
failedcovers storage, persistence and worker failures (Settings.md:180, and the operation columns). - Fixed. The project table is generation state and the delivery acceptance was updated to match (
Settings.md:199, delivery acceptance). The root-opening dependency is still broken (P1 1). - Fixed. The file-profile revision is compared inside the
updatecallback (Settings.md:157). - Partially fixed. Static error enums now serialize with the documented tags, but a callback refusal still loses its code on the wire (P2 3).
- Fixed. The callback is a positional parameter and
ChangeRefusedhasFrom<rutis::host::CallError>(Settings.md:305,486-493). - Fixed.
Scopeis a newtype variant and serializes as{"project": number}(Settings.md:280-285). - Fixed.
agent_readwithholdswriteOnlymembers and the intent says so (Settings.md:130). The absolute "never returned" wording remains a P3. - Fixed.
prompt-overrides.md§3.1 is superseded. Its §4 still namessettings.sources(P2 6). - Partially fixed. The consumer ports are named.
ExecutionSettingsnames the wrong reply type and the appendix does not define the port (P3 9). - Fixed. A schema refusal is invalid params with the validator message (
SettingsMethods.md:88,96). - Partially fixed. The link points at #2080. The operations it names are absent from that contract (P1 1).
- Partially fixed. The request and reply types are defined,
registerreturnsSourceId, andauthorized_projectsis sync. Two compile errors remain (P2 2).
P3:
- Fixed. The execution authority change and the delivery entry are stated (
ExecutionSettings.md:11, delivery). - Fixed.
operation_interruptedis in both owner contracts (PermissionRules.md:71-72,83,CollaborationModelPolicy.md:54-55,66). - Fixed. Five CLI sources, the Web pages, and the Workflow plugin-face read are listed (
SettingsMethods.md:24,28,118; verified against the CLI, Web andruntime/plugins/workflow/catalog.ts). - Partially fixed. The cancellation and error wording still conflict with the dropped-call rule (P3 17).
P1
1. The FileStorage dependency names operations that #2080 does not define.
Problem: Settings.md:117 and Settings.md:191 depend on FileStorage's add_root; ModelLog.md:43 depends on root_path; the delivery caller table repeats both. At #2080's current head (e951536e), FileStorage.md says roots are host-registered values, "the public face exposes neither registration nor root lookup", and its Supersedes paragraph removes the register_root/root_path paragraph. Its operations table has read, write, import, update, create_directory, list and remove.
Failure scenario: an implementation of authorize_project has no operation that opens or registers the project root, so project scopes, authorized_projects, and the Workflow definition path cannot be implemented as written. ModelLog cannot build the recorder's destination from the home root. If this contract lands first, both dependencies are forward references to operations that will not exist.
Fix: name the host root registration and the value that carries the home root, or agree with #2080 on the operation and update this contract, its flows and the delivery in the same change.
P2
2. The binding appendix does not compile.
Problem: Settings.md:406-411 derives Copy for Project, which contains cwd: String (E0204). Settings.md:429-430 uses #[error("{code}: {message}")] on Refused(ChangeRefused), a tuple variant with one unnamed field; thiserror resolves {code} and {message} against the variant's own fields and fails (E0425). Both were confirmed with a minimal compile of the appendix text.
Failure scenario: an implementer copying the appendix gets a crate that does not build, and the delivery's graph and types checks start from this binding.
Fix: drop Copy from Project; use positional field access in the attribute (#[error("{}: {}", .0.code, .0.message)]) or make Refused a named-field variant.
3. A refused change does not keep its own code on the wire.
Problem: the appendix claims "a refused change keeps the callback's own code" (Settings.md:446) and the error table says rejected carries the change's code and message (Settings.md:176). Under rutis 0.23 the service error's code is computed by serde_code (service.rs). The manual Serialize is a struct serializer, which captures Tag from the first field (conflict), while debug_ident is Refused; same_ident("conflict", "Refused") is false, so the wire code falls back to Refused. The callback's code reaches the caller only in the error's data.code. The delivery acceptance for this claim has the same gap.
Failure scenario: a TypeScript or Python owner that branches on error.code sees Refused for every refusal and cannot act on the change's own code, although the contract says it can.
Fix: state that the refusal code is in data.code and update the acceptance, or give the refusal a fixed wire code and carry the dynamic code in data.
4. The source-id row binding contradicts the client path.
Problem: Settings.md:119, Settings.md:138 and the invalid row at Settings.md:172 say a source id from another row is invalid. SettingsMethods.md:77 resolves a declared source name to an id and calls read_user/replace_user with it from another row, and the delivery acceptance says a cross-row id is invalid. The appendix gives read_user and replace_user no caller parameter, unlike read and change (Settings.md:494-503).
Failure scenario: if the binding is enforced as written on the user operations, every settings.read and settings.update returns invalid; if it is not, the contract's stated invariant is false for the user path. An implementer has to guess which rule wins.
Fix: scope the binding to the owner operations read and change, or state the exception that admits SettingsMethods and how the user path crosses rows.
5. declared_sources and agent_read give writeOnly two wire types.
Problem: the declared_sources reply lists writeOnly in each item (Settings.md:132) and the appendix declares write_only: bool (Settings.md:385), while the Data section defines writeOnly as the JSON Pointer list that agent_read returns (Settings.md:144). The retained Sources shape in settings-service.md §4.1 also defines the declaration field as a bool hint.
Failure scenario: a generated TypeScript declaration cannot be both boolean and string[]; a client reading declarations and an agent reading a document disagree about the same field name.
Fix: rename one of the two, for example writeOnlyHint in declarations or withheld in the agent reply, and state both shapes.
6. The sibling contracts still describe the old face, and the Supersedes claims do not cover them.
Problem: PluginManager.md:315-316 still says config returns the user document, revision, schema and user-only fields, lists writeOnlySet, performs an owner update with the revision read, and points at the deleted settings.sources. The new agent path returns {document, writeOnly} and carries no revision, so the PluginManager contract cannot be satisfied by agent_read/agent_set. The service-faces sections the owner contracts claim to supersede remain: service-faces.md:212-216 still defines the three prompt ports and links to the superseded prompt-overrides.md §3.1; service-faces.md:358 and :362 still say executionSettingsHost.read and promptSuggestionSettingsHost.read; service-faces.md:95 still lists the commandRules row; AgentSettings.md:120 still names executionSettingsHost. prompt-overrides.md:108 still says settings.sources publishes the schema, while PromptSettings.md:72 says §4 stays in force. overview.md:103,334,509 still lists settings.sources and settings.projects.
Failure scenario: an implementation that follows the old sibling text keeps a deleted method, adds a revision to the agent path, or removes a value the tool contract promises. A reader cannot tell which document is authoritative.
Fix: update these paragraphs and catalog rows in this change, or list each owning PR and remove the Supersedes claims that are not true. At minimum correct the three prompt port sentence, the §4.10 host names, the commandRules row, AgentSettings.md:120 and prompt-overrides.md §4.
7. The Supersedes retention of §4.1, §6 and §11 is false.
Problem: Settings.md:204 keeps settings-service.md §4.1 shapes, §6 error state meanings and §11 acceptance in force. §4.1's Snapshot is {revision, document} while the new read returns {document}; its Sources shape describes the deleted settings.sources. §6 still documents user_only_field and invalid_scope, while this contract's codes are user_only and invalid. §11 items 1-2 test the revision on the owner read/update path and items 7-10 test settings.sources and settings.projects, all changed here.
Failure scenario: an implementation that satisfies §11 fails the new contract, and the flow tests keep testing removed calls and old codes.
Fix: supersede the changed parts of §4.1, §6 and §11 explicitly and point at the delivery tests, or remove them from the retention list.
8. The consumer examples still do not type-check.
Problem: PromptSettings.md:32 calls prompt_settings.base(...).await.ok().flatten(), but the appendix returns Result<PromptText, _>, so .ok() is Option<PromptText>, which has no flatten(), and factory.base.or(base) expects the factory's Option<Arc<str>>. ProviderSettings.md:32 (Option<UserAgent>) and ModelLog.md:31 (Option<Recording>) have the same pattern, and Provider.md:118 in #2096 copies it. This is the round-1 inline on PromptSettings.md:32.
Failure scenario: the examples cannot be copied into a consumer, so the port migration has no working reference.
Fix: use .await.ok().and_then(|view| view.text) or return the optional value directly; update the #2096 copy and report the owning PR.
P3
ExecutionSettings.md:43names the reply typeExecutionSettingsand the traitExecutionSettingsRead, but the appendix returnsSwitchesand defines no trait (ExecutionSettings.md:128). Name one type and show the port.Settings.md:132,134declaresdeclared_sourcesandauthorized_projectswith no cancellation and no errors, but the flow row atSettings.md:190gives themcancelledandclosedoutcomes. Give the sync operations their own row.Settings.md:234says the caller handlesconflict,user_only,rejectedandunsyncedonly, while the Errors table also exposesinvalid,unknown_source,invalid_document,too_large,failed,closedandcancelled.Settings.md:91usesview.writeOnlyin a Rust comment; the appendix field iswrite_only.subagent-model-policy.md:56links../plugins/CollaborationModelPolicy.md, which resolves todocs/plugins; the target isplugins/CollaborationModelPolicy.md.agent_sethas no code for awriteOnlymember:Settings.md:131,172,175defineinvalidfor a pointer that names no member anduser_onlyfor a member only the user changes, but awriteOnlymember is neither. Name the code or state which one covers it.Settings.md:14andSettings.md:144saywriteOnlymembers are never returned, while the retainedsettings-service.md§4.1 says neither rule scansitems,$defsoranyOf, so a member underitemsis returned. Keep the properties-only scope in this contract.ExecutionSettings.md:71names the portexecutionSettingsHost, but ADR 011 D1's type isExecutionSettingsHost; the delivery deletes that type. Name the type as superseded.SettingsMethods.md:86,90,101,108still mix "the call is dropped" withoperation_interrupted: a caller-cancelled call has no reply, so only owner unload can answer it. Separate the two.service-faces.md:217keeps the heading "settingsService: keep call cancellation" while its body says the row is replaced. Rename the heading with the paragraph.
|
|
||
| ### Dependencies | ||
|
|
||
| - [FileStorage](https://github.com/arcships/dim/pull/2080): `add_root` for an authorized project, `read` and `update` for a document stored as a file, and `create_directory` for the project's directory under `.dimcode`. Settings passes no path outside an authorized root. |
There was a problem hiding this comment.
add_root is not on #2080's FileStorage face at its current head: that contract makes roots host-registered values and says the public face exposes neither registration nor root lookup (its Roots paragraph and Supersedes paragraph). Its operations are read, write, import, update, create_directory, list and remove. The authorize_project flow at line 191 and the delivery both call add_root, so the authorized-project flow has no operation that opens the directory. Fix: name the host root registration and the value that carries the home root, or coordinate with #2080 before this contract lands.
|
|
||
| - [Settings](Settings.md): `register` for the `model-log` source and `read` for its value. | ||
| - The Rust port, for the consumer outside the App Server: the trait `RecordingDestination` lives in `dim-agent-aimux` where the recorder is, and the App Server's `ModelLog` implements it and serves the same read on the wire. | ||
| - FileStorage: `root_path` for the home root, once, to build the destination directory. |
There was a problem hiding this comment.
root_path is not on #2080's FileStorage face: that contract moves root registration to the host and removes root lookup from the face. The recorder has no documented way to learn the home root. Fix: receive the home root as an assembly value, as the host hands root paths to callers, or name the host operation that answers it.
| pub root: ProjectId, | ||
| } | ||
|
|
||
| #[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize)] |
There was a problem hiding this comment.
Project derives Copy with a String field (cwd), which does not compile (E0204). Drop Copy; Clone is enough for every use in the appendix.
| #[error("{0}")] | ||
| UserOnly(String), | ||
| #[error("{code}: {message}")] | ||
| Refused(ChangeRefused), |
There was a problem hiding this comment.
thiserror resolves {code} and {message} against the variant's own fields. Refused(ChangeRefused) is a tuple variant with one unnamed field, so the attribute at line 429 does not compile (E0425, cannot find value code). Use #[error("{}: {}", .0.code, .0.message)] or make the variant Refused { code, message }.
There was a problem hiding this comment.
Partially fixed in fcf1dd5 (head 8ef2691). The Refused(ChangeRefused) tuple variant is gone, but ChangeRefused still has #[error("{code}: {message}")] with fields reason and message (Settings.md:299-303), so thiserror still fails with E0425. Change {code} to {reason}; that clears the two round-2 compile errors together with the Project fix.
There was a problem hiding this comment.
Fixed in 0677c71. Refused(ChangeRefused) is gone; ChangeRefused is a named-field struct with #[error("{reason}: {message}")] (Settings.md:298-304), so both thiserror placeholders resolve.
| } | ||
|
|
||
| impl SettingsError { | ||
| /// The wire `code`; a refused change keeps the callback's own code. |
There was a problem hiding this comment.
Under rutis 0.23 this claim does not hold for a refusal. The error code is computed by serde_code (service.rs): the manual struct serializer captures Tag from the first field, debug_ident is Refused, and same_ident("conflict", "Refused") is false, so the wire code falls back to Refused, not the callback's code. The callback's code reaches the caller only in the error's data.code. Fix: document the data path, or give the refusal a fixed code and carry the dynamic code in data; update the delivery acceptance in the same change.
There was a problem hiding this comment.
Partially fixed in fcf1dd5 (head 8ef2691). The contract fixes the wire code to rejected and carries the callback code in reason (Settings.md:176, :432-433; PR body). The delivery acceptance still has one bullet saying the refusal keeps the callback's code while a later bullet says the code is in reason; delete the stale bullet.
There was a problem hiding this comment.
Fixed in 0677c71. The delivery acceptance (issue comment 7093439923, lines 66 and 71) now has one rule: the wire code is rejected, the callback's code is reason. The old bullet that kept the callback's code on the wire is gone.
|
|
||
| ## Supersedes | ||
|
|
||
| - [Settings service](../appserver/settings-service.md) §4.2 (the `settings` service) and §4.5 (the Rust binding); §4.3 is [SettingsMethods](SettingsMethods.md)'s. The document's §3 state, §4.1 shapes, §4.4 events, §6 errors' state meanings, §7 security and §11 acceptance stay in force; §4.1's `Scope` is the `Scope` below and §4.4's `project_authorized` payload keeps `{root, cwd}`. |
There was a problem hiding this comment.
The retained sections do not stay in force unchanged. settings-service.md §4.1's Snapshot is {revision, document} while the new read returns {document}, and its Sources shape describes the deleted settings.sources. §6 still documents user_only_field and invalid_scope, while this contract's codes are user_only and invalid. §11 items 1-2 test a revision on the owner read/update path and items 7-10 test settings.sources and settings.projects, all changed here. Fix: supersede the changed parts of §4.1, §6 and §11 explicitly and point at the delivery tests, or remove them from the retention list.
There was a problem hiding this comment.
Partially fixed in fcf1dd5 (head 8ef2691). §4.1, §6 and §11 now say superseded, but the same Supersedes bullet keeps §9 and §10 in force, and they still say discovery is settings.sources (settings-service.md:310, :333-336); §1, §1.1 and §2 also still list settings.sources/settings.projects and SettingsService. See the round-3 body.
There was a problem hiding this comment.
Partially fixed in 0677c71. Sections 4.1, 4.2, 4.3, 4.5, 5, 6 and 11 now point at the contracts, and sections 1, 1.1, 2, 3.1, 9 and 10 were updated in this head. Remaining: settings-service.md:284-286 says three methods and :319 says sections 4.1 to 4.4 are the contract; section 8 is unchanged. P3; see the new review.
| - [Settings service](../appserver/settings-service.md) §4.2 (the `settings` service) and §4.5 (the Rust binding); §4.3 is [SettingsMethods](SettingsMethods.md)'s. The document's §3 state, §4.1 shapes, §4.4 events, §6 errors' state meanings, §7 security and §11 acceptance stay in force; §4.1's `Scope` is the `Scope` below and §4.4's `project_authorized` payload keeps `{root, cwd}`. | ||
| - [Settings service](../appserver/settings-service.md) §8.1's note that Rust owners keep their own methods stays; the methods' shapes are in each owner's contract. | ||
| - [Resource owner operations](../contracts/resource-owner-operations.md) §Settings. | ||
| - [Service faces](../service-faces.md) §3.3's `settingsService` row, §3.2's host-port sentence for the three prompt ports, and §4.1's `settingsService` paragraph. |
There was a problem hiding this comment.
The sentence this claims to supersede is not in service-faces §3.2. §3.2 line 104 is the executionSettings/promptSuggestionSettings port sentence; the three prompt ports are in §4 at lines 212-216 and remain, still linking to the superseded prompt-overrides §3.1. ExecutionSettings.md:72 and PromptSuggestionSettings.md:71 make the same claim for §4.10, whose lines 358 and 362 still say executionSettingsHost.read and promptSuggestionSettingsHost.read. Fix: update those sentences, the commandRules row at line 95, and AgentSettings.md:120, or correct the Supersedes claims.
There was a problem hiding this comment.
Partially fixed. The three-prompt-port paragraph in service-faces §4 is now the one promptSettings sentence (service-faces.md:212-216), but Settings.md:209 still points at "§3.2's host-port sentence for the three prompt ports". §3.2's sentence is the executionSettings/toolchainSourceHost/promptSuggestionSettings one (service-faces.md:104). Point at §4.
There was a problem hiding this comment.
Fixed in 0677c71. Settings.md:209 now names section 3.2's host-port sentence for executionSettings and promptSuggestionSettings and section 4's prompt-ports paragraph, which is the paragraph at service-faces.md:212. One precision issue remains at service-faces.md:104 (the sentence pairs the first two names with the first and third contracts); see the new review.
| | Method | Intent | Request | Reply | Cancellation | Errors | | ||
| | --- | --- | --- | --- | --- | --- | | ||
| | `settings.read` | The user's draft base for one declared document | `{source, scope}` | `{revision, document}` | The call is dropped; nothing changes | invalid params, `settings_unknown_source`, `settings_failed`, `operation_interrupted`, reloading | | ||
| | `settings.update` | Replace a declared document with the draft at the revision read | `{source, scope, expectedRevision, document}` | `{revision, document}` | An admitted write commits or ends `settings_unsynced`; a wait dropped before admission changes nothing | invalid params, `settings_unknown_source`, `settings_conflict`, `settings_unsynced`, `settings_failed`, `operation_interrupted`, reloading | |
There was a problem hiding this comment.
The cancellation column says an admitted write commits or ends settings_unsynced, but the errors column lists operation_interrupted, and line 90 says it means the call was cancelled or the part is unloading. A call the caller cancels is dropped and has no reply; only unloading can answer it. The read row at line 85 has the same pair. Separate the two: caller cancellation drops the call, owner unload answers operation_interrupted.
| PromptSources reads the base text once, while its Session part applies. | ||
|
|
||
| ```rust | ||
| let base = prompt_settings.base(cancelled.child_token()).await.ok().flatten(); |
There was a problem hiding this comment.
This still does not type-check. The appendix returns Result<PromptText, _>, so .ok() is Option<PromptText>, which has no flatten(), and factory.base.or(base) expects the factory's Option<Arc<str>>. Use .await.ok().and_then(|view| view.text) or return the optional text directly. ProviderSettings.md:32 and ModelLog.md:31 have the same pattern; Provider.md:118 in #2096 copies it.
There was a problem hiding this comment.
Fixed in 0677c71. PromptSettings.md:32-34 uses the trait's Option<Arc<str>> reply; ProviderSettings.md:32-37 and ModelLog.md:31-38 use and_then on the service reply's optional member. The PromptSettings note to #2096 can be withdrawn: #2096's Provider.md at 05c7515 now uses .ok().flatten() on the port, and no .ok().flatten() remains on a service reply.
| | Read the adopted leader model | `Session::get<PromptSnapshot>(branch_id)` while consuming `collaboration/request`, before starting its delivery task | | ||
| | Resolve an explicit model | The existing `AgentIndex` model-selection host and configured/non-catalog profile paths | | ||
| | Persist and edit policy | Native `BusinessDocument`, `SettingsService::read/update`, source CAS and owner management methods, as used by `permission_rules.rs` | | ||
| | Persist and edit policy | [CollaborationModelPolicy](../plugins/CollaborationModelPolicy.md): the `collaboration` source, its `policy` value read and the `collaboration.*` methods | |
There was a problem hiding this comment.
The link resolves to docs/plugins/CollaborationModelPolicy.md, which does not exist. From docs/design/subagent-model-policy.md the target is plugins/CollaborationModelPolicy.md.
Depend on FileStorage operations that exist in #2080: the host registers roots and hands their paths as values, so Settings and ModelLog take the home directory from the assembly and Settings reads and updates documents by absolute path. The refusal is a Rejected variant whose wire code is rejected and whose callback code is reason; the appendix compiles in a temporary crate. Scope the source-id row binding to read and change, rename the declaration hint to writeOnlyHint, split the sync operations from the cancelled ones, and correct the examples and retained documents the review named.
|
已按评审与自查标准修改,head 评审逐条处理P1
P2
P3
自查(第 1–3 节)
绑定附录临时 crate
Client-visible changes
|
Settings uses add_root for a project authorization, read and update for a document; ModelLog uses root_path for the home root. The home directory arrives as an assembly value, which is a choice: root_path and stat exist and are not needed here.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: nine owner contracts under docs/design/plugins/ for Settings and the settings sections, plus the linked feature designs. Refs #2017 and #2015, under design rules §7 (#2029).
Verdict: REQUEST_CHANGES
Round-2 status
| Round-2 item | Status |
|---|---|
| P1 1 FileStorage operations | Fixed in 8ef2691. #2080 at head 7224c0c defines add_root, root_path and stat (FileStorage.md:159-161) and names #2094 as using add_root, read and update, with ModelLog using root_path (FileStorage.md:226). Settings.md:117,192,200 and ModelLog.md:47 cite them. The round-2 P1 is withdrawn. |
| P2 2 appendix compile | Partially fixed. Project no longer derives Copy (Settings.md:408-413). ChangeRefused still fails, see P2 1 below. |
| P2 3 refusal wire code | Partially fixed. The contract fixes the wire code to rejected and carries the callback code in reason (Settings.md:176,432-433). The delivery acceptance still has the old "keeps the callback's own code" bullet, see P2 7 below. |
| P2 4 cross-row id | Fixed. The row check is scoped to read and change; read_user, replace_user, agent_read and agent_set are exempt (Settings.md:119,138). |
| P2 5 writeOnly types | Fixed. writeOnlyHint is the declaration bool and writeOnly the agent pointer list (Settings.md:132,144,362,387). |
| P2 6 sibling old faces | Partially fixed. service-faces, AgentSettings, prompt-overrides §4 and overview are updated; permission-command-rules §2/§8, subagent-model-policy §3 and EnvironmentSettings.md:109 remain, see P2 4 below. |
| P2 7 retention | Partially fixed. §4.1, §6 and §11 now say superseded, but §1, §1.1, §2, §3.1:122, §8, §9 and §10 still describe the old face, and §9/§10 are explicitly kept in force, see P2 3 below. |
| P2 8 examples | Partially fixed. ProviderSettings and ModelLog use and_then; PromptSettings still does not type-check, see P2 6 below. |
| P3 9-16, 18 | Fixed. |
| P3 17 | Partially fixed. SettingsMethods separates the two rules; PermissionRules and CollaborationModelPolicy still say the call is dropped while listing operation_interrupted. |
Round-1 items not carried above are fixed as the round-2 body reported.
Withdraw the round-2 P1 (FileStorage operations missing): #2080 at 7224c0c restores add_root, root_path and stat, and its sibling list names #2094 as using them. Withdraw round-2 P2 4 (cross-row id) and P2 5 (writeOnly types): both are fixed. Round-2 P2 2, P2 3, P2 6, P2 7 and P2 8 remain partially fixed; P3 17 remains partial; the new P2 items below remain open.
P2
1. The binding appendix still does not compile
Problem: ChangeRefused has fields reason and message, but its thiserror attribute names {code} (Settings.md:299-303). thiserror resolves {code} against the struct's fields and fails.
Failure scenario: an implementer copies the appendix and cargo check fails with E0425, as does the delivery's "appendix compiles" acceptance. The PR body's claim that the appendices compile is false.
Evidence: docs/design/plugins/Settings.md:300; fields at :302-303. Rechecked with the workspace's thiserror 2.0.20: error[E0425]: cannot find value 'code' in this scope.
Fix: #[error("{reason}: {message}")] and re-run the appendix compile.
2. The project root has two owners
Problem: The responsibility split says the project root is host-registered (Settings.md:15), while the Dependencies, the authorize_project flow and the exceptions say Settings calls add_root (Settings.md:117,192,200). One owner must be named.
Failure scenario: a process part authorizes a cwd that is not a Session workspace (Hooks catalog, a management call). If the host is expected to register it, no call opens the directory; the cwd stays outside every FileStorage root, and a project-scope read or write returns invalid. If Settings calls add_root, the summary is false and a reader cannot tell which part owns the root.
Evidence: docs/design/plugins/Settings.md:15 vs :117, :192, :200; #2080 FileStorage.md:159,209.
Fix: say "the FileStorage root Settings registers with add_root for each authorized cwd" and align the PR body paragraph, which still says the project root is registered when the Session is created.
3. The retained settings-service sections still describe the removed face
Problem: The Supersedes bullet keeps §3, §4.4, §7, §8.1, §9 and §10 in force (Settings.md:206). §9:310 and §10:333-336 still say clients discover sources through settings.sources; §1:20-23 lists four management methods and read/update/projects; §1.1:52 says discovery is settings.sources; §2:98-108 diagrams SettingsService and settings.sources/settings.projects; §3.1:122 names SettingsService::register::<D>; §8:272 says CAS and the service are unchanged. SettingsMethods and the delivery delete settings.sources, settings.projects and SettingsService.
Failure scenario: an implementer follows §9 or §10, which the contract says stay in force, and keeps settings.sources as the discovery method; a test or client then expects a method the delivery deletes. §1 and §2 give a second, conflicting description of the service.
Evidence: docs/design/plugins/Settings.md:206; docs/design/appserver/settings-service.md:20-23,41,52,98-108,122,272,310,333-336.
Fix: update §1, §1.1, §2, §3.1:122, §8, §9 and §10 to the new operation and method names, or add them to the Supersedes list with a pointer and stop saying they stay in force.
4. The sibling texts still name the old face
Problem: permission-command-rules.md says in §4.1 that commandRules is deleted (line 112), but §2's structure still shows the CommandRules Session part providing commandRules (line 59), and §8 still lists the Session port commandRules as a public addition (line 307). subagent-model-policy.md:129,151-152 still says the owner depends on Keyed<SettingsService> and CAS, which the owner contract replaces with Settings' register/read/change. EnvironmentSettings.md:109 still names executionSettingsHost, which the delivery deletes.
Failure scenario: a reader implements the CommandRules Session part or the SettingsService dependency from these sections; the target assembly has neither, so the part fails to compose or a second read path remains. The EnvironmentSettings branch binds a service name that no longer exists.
Evidence: docs/design/appserver/permission-command-rules.md:59,307; docs/design/subagent-model-policy.md:129,151-152; docs/design/plugins/EnvironmentSettings.md:109; docs/design/plugins/PermissionRules.md:5,99; docs/design/plugins/ExecutionSettings.md:5,71.
Fix: update those paragraphs in this PR, or name the owning PR in the Supersedes section and remove the claim that the surrounding text stays in force. At minimum change permission-command-rules.md §2/§8, subagent-model-policy.md §3 and EnvironmentSettings.md:109.
5. PromptSettings contradicts itself on the port traits
Problem: Dependencies says the three traits BasePromptSettings, SkillsInstructionsSettings and SummaryPromptSettings stay in dim-agent-capabilities and the App Server implements them (PromptSettings.md:45). The appendix says the three *Host types "and their traits are deleted" (PromptSettings.md:109).
Failure scenario: an implementer deletes the three traits; PromptSources, Skills and ContextCompaction lose their port, and the same document says they depend on it. Or the traits stay and the appendix's deletion statement is false.
Evidence: docs/design/plugins/PromptSettings.md:45,109; the traits exist at crates/dim-agent-capabilities/src/prompt_sources.rs:377, crates/dim-agent-capabilities/src/skills/mod.rs:61, crates/dim-agent-capabilities/src/summary_strategy.rs:126.
Fix: delete only the three *Host wrapper types; say the three traits stay.
6. The PromptSettings consumer example still does not type-check
Problem: The example uses the service reply (view.text, an optional string) and then factory.base.or(base) (PromptSettings.md:32-37). PromptSourcesConfig.base is Option<Arc<str>> (crates/dim-agent-capabilities/src/prompt_sources.rs:368), so or has two different item types. The document also says a consumer outside the App Server depends on the trait, whose base returns Option<Arc<str>> (:377-379), not PromptText, so .text does not exist there.
Failure scenario: the example cannot be copied; the port migration has no working reference. ProviderSettings.md:35 and ModelLog.md:35 now use and_then, but the PromptSettings one remains.
Evidence: docs/design/plugins/PromptSettings.md:32-37; crates/dim-agent-capabilities/src/prompt_sources.rs:368,377-379.
Fix: show the trait call and its Option<Arc<str>> reply, for example let base = prompt_settings.base(cancelled.child_token()).await.ok().flatten();, or make the service reply's text Option<Arc<str>> and use the service. Report the same to #2096's Provider.md:118, which still has .ok().flatten() on the service reply.
7. The delivery acceptance still asserts the callback's code on the wire
Problem: The delivery acceptance has one bullet saying the refusal keeps the callback's own code and message, while a later bullet says the rejected wire code is fixed and the callback's code is in reason. The contract is the second shape (Settings.md:176,432-433).
Failure scenario: a test author implements the first bullet, expects error.code to be the callback's code, and either fails the acceptance or reintroduces the dynamic wire code that round 2 asked to remove.
Evidence: delivery comment #2017 (comment), the acceptance bullet starting "每个附录的错误枚举"; docs/design/plugins/Settings.md:176,432-433.
Fix: delete the stale bullet and keep one assertion: the wire code is rejected, and the callback's own code is reason.
P3 (optional)
Settings.md:110callsstorage.read(definitions, cancelled), but FileStorage's binding isread(path, offset: Option<u64>, length: Option<u32>, cancelled)(#2080 FileStorage.md:448-456). Usestorage.read(definitions, None, None, cancelled).Settings.md:209says the Supersedes covers "§3.2's host-port sentence for the three prompt ports". §3.2 is theexecutionSettings/toolchainSourceHost/promptSuggestionSettingssentence (service-faces.md:104); the prompt ports paragraph is in §4 (212-216), which this PR already rewrote. Point at §4.PermissionRules.md:71-72,83andCollaborationModelPolicy.md:54-55,66still say "the call is dropped" while listingoperation_interrupted; SettingsMethods now separates caller cancellation (no reply) from owner unload. Use the same rule.- The PR body's FileStorage paragraph still says "the host registers roots and hands their paths as values" and "the project root is registered when the Session is created"; the delivery and Settings.md:117 now say Settings calls
add_rootforauthorize_project. - Cross-PR: #2096's
Provider.md:118still has.ok().flatten()onResult<Recording>. #2101'sPluginManager.mdhead still carries the oldsettings.sources/writeOnlySetconfig rows that this PR replaces. Report both to their owners; neither is changed here. - ADR 027 is proposed in #2029 and is not on main; the Rule check rows reference it without a link. Link it or label it proposed, as FileStorage does for §7.
Verification and CI
node scripts/adr-check.mjs --base 1bc7d67d: "ADR freeze passed: 23 changed files". CI for 8ef2691: changes and ci-ok succeeded; the other jobs were skipped by the path filter. The appendix compile check with thiserror 2.0.20 fails as shown in P2 1.
| - **Documents and revisions.** The user document (a file, or a row in the native store) and the project document (a file under an authorized project); the opaque revision that changes on every committed write; one writer at a time per document. | ||
| - **Change application.** Running a caller's change against the current document under the owner's exclusion, checking the result, writing it, publishing the fact, and reporting whether durability is confirmed. | ||
| - **Authority.** An owner change and an agent change may not alter a user-only member; a user edit may. Every member marked `writeOnly` that is reachable through `properties` is withheld from the agent, and the agent may not set it; the rule does not scan `items`, `$defs` or `anyOf`. | ||
| - **Authorized projects.** The cwd → project table, the host-registered project root each authorized cwd denotes, and the fact announcing a new one. |
There was a problem hiding this comment.
Problem: The responsibility split says the project root is host-registered, but Dependencies, the authorize_project flow and the exceptions say Settings calls add_root (117, 192, 200). Failure scenario: a cwd authorized without a Session workspace (Hooks catalog, a management call) is never opened as a FileStorage root if the host is expected to do it; a project-scope read or write then returns invalid. Evidence: this line vs 117, 192, 200; #2080 FileStorage.md:159,209. Fix: say "the FileStorage root Settings registers with add_root for each authorized cwd" and align the PR body paragraph.
There was a problem hiding this comment.
Fixed in 0677c71. Settings.md:15 now says Settings registers the FileStorage root with add_root for each authorized cwd; :117, :192 and :200 agree, and the PR body says the same. One owner, Settings.
|
|
||
| ## Supersedes | ||
|
|
||
| - [Settings service](../appserver/settings-service.md) §4.1 (common shapes: `Snapshot`, `Sources`, `SettingsScope`), §4.2 (the `settings` service), §4.5 (the Rust binding), §5 (the operations' flows), §6 (the error codes) and §11 (acceptance). §4.3 is [SettingsMethods](SettingsMethods.md)'s. The document's §3 state, §4.4 events, §7 security, §8.1, §9 and §10 stay in force; §4.4's `project_authorized` payload keeps `{root, cwd}`, and the new acceptance is the delivery's flow tests. |
There was a problem hiding this comment.
Problem: This bullet keeps §9 and §10 in force, but they still say discovery is settings.sources (settings-service.md:310,333-336); §1, §1.1, §2, §3.1:122 and §8 also still list settings.sources, settings.projects, workflowFiles and SettingsService. Failure scenario: an implementer following the retained sections keeps a method the delivery deletes, or rebuilds the removed service. Evidence: this line; settings-service.md:20-23,41,52,98-108,122,272,310,333-336. Fix: update those sections or add them to the Supersedes list and remove them from the retained set.
There was a problem hiding this comment.
Partially fixed in 0677c71. Section 1, 1.1, 2, 3.1, 9's rule 7 row and 10's question 5 now describe discovery by name. Remaining: settings-service.md:319 still says sections 4.1 to 4.4 are the contract while 4.1, 4.2, 4.3 and 4.5 are pointers or superseded, and :284-286 still says three methods (today four, target two). Section 8 is neither retained nor superseded, and the PR body says it links to the contracts. Both are P3; see the new review.
|
|
||
| /// One document's replacement from the change callback: its own `reason` and `message`. | ||
| #[derive(Debug, thiserror::Error)] | ||
| #[error("{code}: {message}")] |
There was a problem hiding this comment.
Problem: ChangeRefused has fields reason and message (302-303), but the attribute names {code}; thiserror resolves it against the struct's fields. Failure scenario: the appendix fails with E0425, and the delivery's compile acceptance fails. Evidence: this line; rechecked with thiserror 2.0.20. Fix: #[error("{reason}: {message}")].
There was a problem hiding this comment.
Fixed in 0677c71. Settings.md:300 is #[error("{reason}: {message}")] with fields reason and message; thiserror resolves named fields, so the E0425 is gone.
| .await | ||
| .ok() | ||
| .and_then(|view| view.text); | ||
| let text = factory.base.or(base).unwrap_or_else(|| BUILT_IN.into()); |
There was a problem hiding this comment.
Problem: The service reply's text is an optional string, while factory.base is Option<Arc<str>> (crates/dim-agent-capabilities/src/prompt_sources.rs:368); or cannot mix the two. A consumer also depends on the trait BasePromptSettings, whose base returns Option<Arc<str>> (:377-379), not PromptText, so .text does not exist there. Failure scenario: the example cannot be copied. Evidence: PromptSettings.md:32-37; prompt_sources.rs:368,377-379. Fix: use the trait call, for example let base = prompt_settings.base(cancelled.child_token()).await.ok().flatten();, or make the service reply's text Option<Arc<str>>. Report the same to #2096 Provider.md:118.
There was a problem hiding this comment.
Fixed in 0677c71. PromptSettings.md:32-34 now calls the BasePromptSettings trait and uses .ok().flatten(); prompt_sources.rs:368,377-379 shows base returning Option<Arc<str>>, so the example type-checks and factory.base.or(base) has two Option<Arc<str>> operands.
|
|
||
| ## Binding appendix | ||
|
|
||
| The three reads are one service on the owner type; the old `BasePromptSettingsHost`, `SkillsInstructionsSettingsHost` and `SummaryPromptSettingsHost` types and their traits are deleted. |
There was a problem hiding this comment.
Problem: This deletes "their traits", but Dependencies (line 45) says the three traits BasePromptSettings, SkillsInstructionsSettings and SummaryPromptSettings stay in dim-agent-capabilities and the App Server implements them. Failure scenario: an implementer deletes the traits, breaking PromptSources, Skills and ContextCompaction, which the same document says depend on them. Evidence: this line; PromptSettings.md:45; crates/dim-agent-capabilities/src/prompt_sources.rs:377, src/skills/mod.rs:61, src/summary_strategy.rs:126. Fix: delete only the three *Host wrapper types; keep the traits.
There was a problem hiding this comment.
Fixed in 0677c71. PromptSettings.md:106 now deletes only the three *SettingsHost wrapper types and keeps BasePromptSettings, SkillsInstructionsSettings and SummaryPromptSettings; line 42 says the same. The delivery deletion list (issue comment 7093439923, line 10) still says the host types' traits are deleted too, which contradicts this line and delivery line 29; the new review covers it.
| .find(|project| project.cwd == cwd) | ||
| .ok_or(WorkflowError::WorkspaceNotAuthorized)?; | ||
| let definitions = format!("{}/.dimcode/workflows/{}", project.cwd, name); | ||
| let bytes = storage.read(definitions, cancelled).await?; // FileStorage's operation |
There was a problem hiding this comment.
Problem: storage.read(definitions, cancelled) omits offset and length; FileStorage's binding is read(path, Option<u64>, Option<u32>, CancelledFn) (#2080 FileStorage.md:448-456). Failure scenario: the example does not compile against the contract it cites. Fix: storage.read(definitions, None, None, cancelled).await?.
Settings says it registers each authorized cwd with add_root; the Workflow example passes the offset and length arguments; ChangeRefused names its reason field. PromptSettings keeps the three capability traits and uses the port's optional read in its example. The retained settings-service sections no longer list settings.sources, settings.projects, workflowFiles or SettingsService, and the service-faces Supersedes points at the paragraph it changes.
|
已按评审修改,head 评审逐条
自查 1–9
留给第二步(left for step 2)
绑定附录临时 crate Client-visible changes与上一轮相同:
|
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: nine owner contracts under docs/design/plugins/ for Settings and the settings sections, plus the linked feature designs. Refs #2017 and #2015, under design rules §7 (#2029).
Verdict: REQUEST_CHANGES
Round-3 status
| Round-3 item | Status |
|---|---|
P2 1 ChangeRefused compile |
Fixed in 0677c71. Settings.md:300 is #[error("{reason}: {message}")] with fields reason and message; the E0425 is gone. |
| P2 2 project-root owner | Fixed. Settings.md:15 says Settings registers the FileStorage root with add_root for each authorized cwd; :117, :192, :200 and the PR body agree. |
| P2 3 retained settings-service sections | Partially fixed. §1, §1.1, §2, §3.1, §9's rule 7 row and §10 question 5 now describe discovery by name. §8 (settings-service.md:284-286, "three methods") and §9's ADR 002 D5 row (:319, "§4.1 to §4.4 are the contract") remain; see P3. |
| P2 4 sibling old faces | Not fixed. permission-command-rules.md §2 and §4.2, subagent-model-policy.md §3 and EnvironmentSettings.md:109 still name the deleted faces; see P2 1. |
| P2 5 PromptSettings traits | Fixed in the contract (PromptSettings.md:42, :106). The delivery deletion list still says the host types' traits are deleted too; see P2 2. |
| P2 6 PromptSettings example | Fixed. PromptSettings.md:32-34 calls the trait and uses .ok().flatten(); prompt_sources.rs:368,377-379 has the Option<Arc<str>> reply. |
| P2 7 delivery acceptance | Fixed. The delivery comment, updated 05:31, now says the wire code is rejected and the callback's code is reason (lines 66 and 71). |
| P2 8 examples | Fixed for ProviderSettings and ModelLog; PromptSettings now type-checks. |
| P3 9-16, 18 | Fixed earlier or not reopened. P3 17 remains partial for PermissionRules and CollaborationModelPolicy. |
Withdraw round-3 P2 1, P2 2, P2 6 and P2 7: verified fixed. P2 3 is partly fixed and the remainder is P3. P2 4 remains. P2 5 is fixed in the owner contract but open in the delivery.
P2
1. The sibling designs still define the deleted faces
Problem: This PR deletes the commandRules Session service, SettingsService, executionSettingsHost and BasePromptSettingsHost, but the linked designs still define them: permission-command-rules.md:58-59 shows the CommandRules Session part providing commandRules and reading Settings, :163-165 says the dispatcher serves read({}), :176 declares Keyed<SettingsService> for the feature and the owner row, and :307 lists the port as a public addition. subagent-model-policy.md:129 says the owner depends on Keyed<SettingsService>, :151-152 declares the dependency as When<Keyed<SettingsService>>, and :306, :313 and :321 still describe Settings CAS methods. EnvironmentSettings.md:109 names executionSettingsHost. PromptSources.md:55 names BasePromptSettingsHost. resource-owner-operations.md:14 still lists settings.register/read/update/projects, and :24 names SettingsService.declared_by and settings.sources. management-methods.md:65 still names SettingsService.
Failure scenario: an implementer follows permission-command-rules.md §2 or §4.2 and builds a Session part that reads SettingsService::read::<PermissionSettings>; the delivery removes SettingsService and the commandRules wire service, so the part fails to compose or leaves a second read path. Following subagent-model-policy.md §3 injects a service the target deletes. Binding executionSettingsHost or BasePromptSettingsHost binds names that no longer exist.
Evidence: docs/design/appserver/permission-command-rules.md:58-59,163-165,176,307; docs/design/subagent-model-policy.md:129,151-152,306,313,321; docs/design/plugins/EnvironmentSettings.md:109; docs/design/plugins/PromptSources.md:55; docs/design/contracts/resource-owner-operations.md:14,24; docs/design/appserver/management-methods.md:65; target at docs/design/plugins/PermissionRules.md:5,64,115, ExecutionSettings.md:71, PromptSettings.md:42,106.
Fix: update those paragraphs to the owner contracts, or mark them superseded in Settings.md and link. At minimum change permission-command-rules.md §2, §4.2 and §8, subagent-model-policy.md §3, EnvironmentSettings.md:109 and PromptSources.md:55. The subagent table row at line 56 was updated in this head, but §3 was not. PromptSources.md:55 and resource-owner-operations.md:14,24 are the same class and were missed in earlier rounds; this head fixed the identical port sentence in ContextCompaction.md:1983, which makes the omission visible.
2. The delivery deletion list still deletes the port traits
Problem: The delivery deletion list (https://github.com/arcships/dim/issues/2017#issuecomment-7093439923, line 10) lists the five *Host types and then says their traits are deleted too. The owner contracts keep BasePromptSettings, SkillsInstructionsSettings and SummaryPromptSettings (PromptSettings.md:42, :106), ExecutionSettingsRead (ExecutionSettings.md:43) and PromptSuggestionSettingsRead (PromptSuggestionSettings.md:43) as the Rust ports. Delivery line 29 itself says the consumers migrate through the three prompt traits.
Failure scenario: an implementer follows the deletion list and removes the traits. PromptSources, Skills, ContextCompaction, HostPlatform and PromptSuggestion lose their ports and fail to compile, and the migration in delivery line 29 has no target. If the traits stay, the deletion acceptance fails.
Evidence: delivery comment line 10 versus line 29; docs/design/plugins/PromptSettings.md:42,106; docs/design/plugins/ExecutionSettings.md:43; docs/design/plugins/PromptSuggestionSettings.md:43; the traits exist at crates/dim-agent-capabilities/src/prompt_sources.rs:377, src/skills/mod.rs:61, src/summary_strategy.rs:126.
Fix: delete only the *Host wrapper types; keep the traits. Align the delivery deletion list and line 29 with PromptSettings.md:106.
P3 (optional)
docs/design/service-faces.md:104: the Chinese sentence says "the former two" (前两者), which names the first two entries (executionSettings,toolchainSourceHost), but the cited contracts areExecutionSettingsandPromptSuggestionSettings, the first and third names.Settings.md:209also calls this "§3.2's host-port sentence" and lists only the two changed names, so as written the Supersedes would also covertoolchainSourceHost, which this PR does not change. Name the two entries explicitly.docs/design/appserver/settings-service.md:54: "no method lists every declaration" is false for the service operationdeclared_sources, which lists all declared sources or one instance's (Settings.md:132). The sentence means the client path; say "no client method".docs/design/plugins/PermissionRules.md:71-72,83andCollaborationModelPolicy.md:54-55,66still say the call is dropped while listingoperation_interrupted. UseSettingsMethods.md:90: a caller-cancelled call has no reply; only owner unload answersoperation_interrupted.docs/design/appserver/settings-service.md:284-286says "three methods" (today four, target two), and:319says "§4.1 to §4.4 are the contract" while §4.1, §4.2, §4.3 and §4.5 are now pointers or superseded. §8 is neither retained nor superseded, and the PR body says it links to the contracts.- The delivery cross-row acceptance bullet (line 64) says a cross-row source id is
invalidwithout theread_user/replace_userexception stated at line 72. Say "forreadandchange". Settings.md:117andModelLog.md:47pin #2080 at head7224c0cd4; #2080's current head is08d29c84.add_root,readandroot_pathare unchanged there andupdateonly gained an optionalclaim_id, so the calls still match, but update the pin or say "reviewed head".
Cross-PR
- #2093 at
a4f23773:SummaryStrategy.md:64namesS:summaryPromptSettingsHost, which this PR deletes; ask it to use theSummaryPromptSettingstrait or thepromptSettingsservice. Itsservice-faces.mdhunk at line 94 also overlaps this PR'scommandRulesrow, so expect a conflict. - #2101 at
18d5e4f0:PluginManager.md:338still carriessettings.sourcesandwriteOnlySet; this PR updates the same rows at:315-316. Ask #2101 to rebase. - #2096 at
05c75154:Provider.md:118,141now read ModelLog'srecordingthrough the port, so the round-3 cross-PR note is withdrawn. - #2102 at
44e64199: itsPromptAdoptionconfiguredoes not touch the renamed prompt ports; itsservice-faceshunks do not overlap this PR's. No conflict.
Verification and CI
node scripts/adr-check.mjs --base 1bc7d67d: "ADR freeze passed: 23 changed files". Relative links in the changed docs resolve. The ChangeRefused attribute now names a struct field, and CallError::raw (rutis 0.23 service.rs:607) and session::Error::code (rutis-bridge 0.23 session/mod.rs:244) exist, so the refusal conversion compiles. CI for 0677c715: changes and ci-ok succeeded; the other jobs were skipped by the docs path filter.
| `CommandRule = {command: string, match: "exact" | "prefix", decision: "allow" | "deny"}`. Errors | ||
| are data: `unavailable` (the source could not be read, including an invalid persisted file), | ||
| `cancelled` (the caller dropped the call or the provider is unloading). | ||
| **Session service `commandRules`** is deleted. Rule consumers call [PermissionRules](../plugins/PermissionRules.md)'s `permissionRules.rules` (`{}` → `{rules}`); `CommandRule = {command: string, match: "exact" | "prefix", decision: "allow" | "deny"}`. |
There was a problem hiding this comment.
Problem: This deletes the Session service, but the same file still builds it. Section 2 (58-59) shows the CommandRules Session part providing commandRules and reading Settings; 4.2 (163-165) says the dispatcher serves read({}); 4.2 (176) declares Keyed<SettingsService>; and section 8 (307) lists the port as a public addition.
Failure scenario: an implementer follows section 2 or 4.2 and builds a Session part that reads SettingsService::read::<PermissionSettings>; the delivery removes SettingsService and the commandRules wire service, so the part fails to compose or leaves a second read path.
Evidence: those lines; docs/design/plugins/PermissionRules.md:5,64,115.
Fix: update sections 2, 4.2 and 8 to the owner's permissionRules.rules and the ReadCommandRules port binding, as 4.1 already does.
| | Read the adopted leader model | `Session::get<PromptSnapshot>(branch_id)` while consuming `collaboration/request`, before starting its delivery task | | ||
| | Resolve an explicit model | The existing `AgentIndex` model-selection host and configured/non-catalog profile paths | | ||
| | Persist and edit policy | Native `BusinessDocument`, `SettingsService::read/update`, source CAS and owner management methods, as used by `permission_rules.rs` | | ||
| | Persist and edit policy | [CollaborationModelPolicy](plugins/CollaborationModelPolicy.md): the `collaboration` source, its `policy` value read and the `collaboration.*` methods | |
There was a problem hiding this comment.
Problem: This row moved to the new contract, but section 3 still declares the old dependency: line 129 says the owner depends on Keyed<SettingsService>, 151-152 uses When<Keyed<SettingsService>>, and 306, 313 and 321 still describe Settings CAS methods.
Failure scenario: the implementation adds a SettingsService dependency the delivery deletes, and the owner reads the store instead of the new policy value.
Evidence: docs/design/subagent-model-policy.md:129,151-152,306,313,321; docs/design/plugins/CollaborationModelPolicy.md:45,82.
Fix: update section 3 to the settings service and collaborationPolicy.policy; keep this row's link.
| replacement. Settings performs serialization, version checks and persistence. Both calls | ||
| propagate the original Settings error and end with the registration generation. Foreign codec | ||
| calls occur outside SQLite transactions. Declared-schema sources reuse their existing codec. | ||
| The Settings operations, the authorized-project table and each source's own contract are defined by [Settings](../plugins/Settings.md) and [SettingsMethods](../plugins/SettingsMethods.md). The `settingsService` owner API and the `registerDocument` operation are replaced by the one `settings` service: a source id per registration, a value read, a change callback, the user draft path and the agent path. |
There was a problem hiding this comment.
Problem: This paragraph replaces the section, but the same file still names the old API: the settingsService row at line 14 says settings.register/read/update/projects and links to the superseded settings-service.md 4.2, and the binding at line 24 names SettingsService.declared_by and settings.sources.
Failure scenario: PluginManager or SettingsMethods is implemented from lines 14 or 24, keeping update, projects or declaredBy; the target uses register/read/change and declared_sources, and the delivery deletes declared_by and settings.sources.
Evidence: docs/design/contracts/resource-owner-operations.md:14,24; docs/design/plugins/Settings.md:119-134; delivery deletion list lines 11-14.
Fix: update the settingsService row and the declaredBy binding to the new operations, or mark them superseded by this paragraph.
|
|
||
| ## Supersedes | ||
|
|
||
| - [Settings service](../appserver/settings-service.md) §4.1 (common shapes: `Snapshot`, `Sources`, `SettingsScope`), §4.2 (the `settings` service), §4.5 (the Rust binding), §5 (the operations' flows), §6 (the error codes) and §11 (acceptance). §4.3 is [SettingsMethods](SettingsMethods.md)'s. The document's §3 state, §4.4 events, §7 security, §8.1, §9 and §10 stay in force; §4.4's `project_authorized` payload keeps `{root, cwd}`, and the new acceptance is the delivery's flow tests. |
There was a problem hiding this comment.
Problem: This keeps section 9 and section 10 in force, and they now agree on discovery. Two retained pieces are stale: settings-service.md:319 says sections 4.1 to 4.4 are the contract while 4.1, 4.2, 4.3 and 4.5 are pointers or superseded, and settings-service.md:284-286 says three methods (today four, target two). Section 8 is neither retained nor superseded, and the PR body says it links to the contracts.
Failure scenario: a reader takes section 9's ADR 002 D5 row as the contract map and looks for the user draft and agent paths in 4.1 to 4.4, or takes the three-method count as the client surface.
Evidence: docs/design/appserver/settings-service.md:284-286,319; the PR body paragraph that lists section 8.
Fix: optional. Point section 8 and 9's D5 row at Settings and SettingsMethods, or add section 8 to the Supersedes list.
| | `toolSourcesView` | `toolSourcesView.get/observe` | 同一 ToolRegistry owner 的独立只读观察面;贡献注册仍由 `toolRegistry` 负责,见 [工具贡献 §7.5](../architecture/rust-agent/tool-contributions.md#75-服务接口)。 | | ||
|
|
||
| 宿主读取端口的数据面(§4.10)包括 `executionSettingsHost`、`toolchainSourceHost`、`promptSuggestionSettingsHost`。模型选择与列表统一由 `providerService` 提供;调用方和配置见[进程操作](contracts/process-owner-operations.md);其余读取端口沿用现名。 | ||
| 宿主读取端口的数据面(§4.10)包括 `executionSettings`、`toolchainSourceHost`、`promptSuggestionSettings`;前两者的操作由 [ExecutionSettings](plugins/ExecutionSettings.md) 与 [PromptSuggestionSettings](plugins/PromptSuggestionSettings.md) 定义。模型选择与列表统一由 `providerService` 提供;调用方和配置见[进程操作](contracts/process-owner-operations.md);其余读取端口沿用现名。 |
There was a problem hiding this comment.
Problem: 前两者 refers to the first two names in the list (executionSettings, toolchainSourceHost), but the two cited contracts are ExecutionSettings and PromptSuggestionSettings, the first and third names. Settings.md:209 also calls this the section 3.2 host-port sentence and lists only the two changed entries, so as written the Supersedes would also cover toolchainSourceHost, which this PR does not change.
Failure scenario: a reader pairs toolchainSourceHost with PromptSuggestionSettings, or treats the whole sentence as superseded and leaves toolchainSourceHost without its entry.
Evidence: this line; docs/design/plugins/Settings.md:209; docs/design/plugins/ExecutionSettings.md:72; docs/design/plugins/PromptSuggestionSettings.md:71.
Fix: name the two entries explicitly, for example the executionSettings and promptSuggestionSettings host-port entries.
| - Source discovery is `settings.sources` (§4.3): local connections can list the declared | ||
| sources and their schemas, never their documents. There is still no settings UI. | ||
| - Source discovery is by name: a local client reads and writes the declared sources it knows | ||
| through `settings.read`/`settings.update`; no method lists every declaration (`settings.sources` |
There was a problem hiding this comment.
Problem: declared_sources lists every declaration (Settings.md:132), so the claim that no method lists every declaration is false for the service. The sentence means the client path.
Failure scenario: a reader concludes declared_sources should not exist, but PluginManager's config command needs it (PluginManager.md:315).
Evidence: this line; docs/design/plugins/Settings.md:132; docs/design/plugins/SettingsMethods.md:24; docs/design/plugins/PluginManager.md:315.
Fix: say no client method lists every declaration.
| | invalid params | Fix the request: a rule without a command word, or with a shell separator | | ||
| | `permission_rules_conflict` | Read again; the user's draft is stale | | ||
| | `permission_rules_failed` | Read again before retrying | | ||
| | `operation_interrupted` | The call was cancelled or the owner is unloading; read again before retrying | |
There was a problem hiding this comment.
Problem: This says a cancelled call answers operation_interrupted, while the cancellation column at 71-72 says the call is dropped. SettingsMethods.md:90 fixes the rule: a caller-cancelled call has no reply; only owner unload answers operation_interrupted.
Failure scenario: a client waits for a reply on a call it cancelled, or treats an unload as a cancellation and retries a write.
Evidence: docs/design/plugins/PermissionRules.md:71-72,83; docs/design/plugins/CollaborationModelPolicy.md:54-55,66 has the same pair; docs/design/plugins/SettingsMethods.md:90.
Fix: use the SettingsMethods rule in both tables.
|
补充说明(ADR 027 收回到决定层后):本 PR 的契约没有 |
|
Closing as part of abandoning the owner-split experiment. |
Target contracts for the Settings board (#2017) under design rules §7 (#2029) and ADR 027.
Design part,
docs/design/plugins/:settingsservice.registertakes the declaration with its user-only members and answers a source id bound to the registering row; a Rust document type registers through the same operation with the type as its codec. Owners read a value by source id and change a document through a positional callback the owner runs under its exclusion; the user path takes the draft revision and keeps the{revision, document}reply; the agent path serves declared sources only and withholdswriteOnlymembers. Settings registers each authorized cwd with FileStorage'sadd_rootand reads the home directory as an assembly value; a document is read and updated by absolute path (#2080 head7224c0cd4). The user-document rows are Settings' own:readUser,importUserIfAbsent,changeUserandreplaceUserare crate-private operations executed by the storage engine, andsqliteStoragepublishes onlystorageReportand the offline operations (#2091).settings.*methods keep their request and reply shapes and serve declared sources only; typed request structs in the examples; the Web entry is served for its allowlisted sources;settings.sourcesandsettings.projectsare removed.workflowFiles,commandRulesand the three prompt host names are removed. Workflow definition files come from FileStorage with the project resolved fromauthorized_projects;permissionRules.rulesreplacescommandRules.read; the prompt texts come from onepromptSettingsservice. Error enums carry{code, message}with snake_case codes; a refusal is therejectedcode with the change's own code inreason; declarations expose awriteOnlyHint, the agent path itswriteOnlypointer list.Each contract has a Supersedes section, and the paragraphs describing this board in
settings-service.md(§1, §1.1, §2, §3.1, §4.1, §4.2, §4.3, §4.5, §5, §6, §8, §9, §10, §11),prompt-overrides.md(§3, §3.1, §7),permission-command-rules.md§4.1,service-faces.md,resource-owner-operations.md§Settings,management-methods.md,subagent-model-policy.md,model-log.md,provider-management.md,PluginManager.md,AgentSettings.md,ContextCompaction.mdandoverview.mdlink to the contracts.The binding appendices compile in a temporary crate (workspace crates + rutis 0.23, rust 1.100); the wire shapes asserted there match the error table. Requirements raised to Provider (#2019) and Workflow (#2033) are stated in the Settings contract.
Delivery part (deletion list, caller migration, implementation task, acceptance, client-visible changes): #2017 (comment)
Refs #2017
Refs #2015
Merge order
#2029 → #2080 → #2091/#2092/#2093 → #2094 → #2096 → the rest.
Sibling heads this change is aligned with: #2096
9ca30e0f8. A paragraph that depends on a sibling names that PR; its head is the one above.