Repository navigation
Conversation
Six owner contracts under design rules §7: ToolBinding, ToolExecutor, Approval, Permission, BackgroundExec and FileReads. Each states its responsibility split, caller intents, operations, errors, flows, rule check and the requirements raised to ToolRegistry, Prompt, the Session access mechanism and HostPlatform.
ToolRegistry adopt/release/run/resolve_write/ordering/claim/release_claims, Prompt configure, PermissionRules rules, HostPlatform spawn/wait/kill/settle, and ToolExecutor close for Code Mode's effects.
fileAccessFacts.check takes {access, mode, path}; the service is resolved at the Session instance, so no Session id is a request field and Permission no longer needs SessionScope identity.
fileAccessFacts.check takes {access, mode, path}; the service is resolved at the Session instance.
|
评审(head
|
The registry keeps the Session's resolvable generations; ToolBinding keeps a line's request record, its pins and its claims. bind/claim call the registry, transfer moves the record, and the owner settles the record and its claims from step/tool-result and turn/end instead of Loop releasing on every path.
|
已按评审修改,head
|
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: This PR adds six branch-scope owner contracts for the tool chain (ToolBinding, ToolExecutor, Approval, Permission, BackgroundExec and FileReads) and indexes them in docs/design/plugins/README.md. Each document states the responsibility split, the operations with cancellation and errors, the flows, exceptions, rule check and requirements raised to sibling owners. Refs #2028 and #2015.
Verdict: REQUEST_CHANGES
P1: none.
P2
-
The wire codes in every error table disagree with the appendices and with the published faces.
Problem: all six tables use lowercase or snake_case kinds such asalready_bound,no_batch,unknown_taskandinvalid_limit(ToolBinding.md:140-148, ToolExecutor.md:86-93, Approval.md:88-93, Permission.md:98-103, BackgroundExec.md:94-101, FileReads.md:86-88), while every error enum in the binding appendices derives Debug and Display only (ToolBinding.md:253-263, ToolExecutor.md:194-204, Approval.md:184-194, Permission.md:236-246, BackgroundExec.md:205-219, FileReads.md:202-206). The rutis binding takes a method error's wire code from its serde form when the type implements Serialize, otherwise from the Debug variant name. These enums therefore produceAlreadyBound,NoBatch,UnknownTaskandInvalidLimit. The already-published faces also use other spellings:invalidLimitandread(docs/architecture/rust-agent/plugins/WorkspaceTools.md:549,566) andUnknown/Cancelled/Closed(docs/architecture/rust-agent/plugins/Permission.md:343-345).
Failure scenario: a cross-language caller matchinginvalid_limitorno_batchnever matches; an existing backgroundExec client matchinginvalidLimitbreaks even if the new spelling is adopted; Rust callers do not see the mismatch until the wire is used.
Fix: derive Serialize and Deserialize on each error enum with the documented rename, or document the Debug names; make one compatibility decision for the publishedinvalidLimitandUnknowncodes; do the same for value strings such asnever_read(FileReads.md:79) versus the appendix's camelCaseneverRead(FileReads.md:180-183). -
Permission.advise cannot be a data operation and cannot be withdrawn at the caller's unload.
Problem: AdviseRequest derives Debug, Serialize and Deserialize (Permission.md:208-211) over AdviseFn, anArc<dyn Fn>(Permission.md:230-234) that implements none of them; the callback argument type AdviceRequest is undefined; and the operation carries no caller context or lease id. The current registration is bound to the caller's rutis row throughctx: &Ctx(crates/dim-agent-capabilities/src/permission.rs:238-247).
Failure scenario: the appendix does not compile, a foreign caller cannot pass a function inside serde data, and a Hooks reload cannot withdraw its advisor, so stale advice can still deny or ask a call.
Fix: make the callback a method parameter with the caller's&Ctx(and keep it off the data face if the binding cannot carry it), or return a lease id and add a release operation; define the advice input as data. -
The existing target contracts still require the removed surfaces.
Problem: docs/design/contracts/runtime-owner-operations.md:63,76-77 defines fileReads asbinding({path}),writeBinding({path})andrecord(...), and toolBinding asbind,bindCurrent,definitions,transferandrelease; docs/design/service-faces.md:139-140,156 listspermission.check,approval.pending()/decide(requestId, decision)and the positional backgroundExec methods; docs/design/contracts/session-boundary.md:391 namesPrompt::adopt_toolsandbind_current. The new documents remove or rename all of these.
Failure scenario: delivery follows either contract and breaks the other, and callers reading the retained-operations table still call operations the owners no longer have.
Fix: update these documents in this PR or raise the conflicting entries as requirements with their owning PRs, and state which surface supersedes. -
Owner-internal read and append failures have no error kind.
Problem: BackgroundExec.md:85-101 drops the publishedreadcode (docs/architecture/rust-agent/plugins/WorkspaceTools.md:549,566); Approval.md:88-93 has no kind for a failedapproval/requestcommit, which current code maps tofailed(crates/dim-agent-capabilities/src/approval.rs:163-174); Permission.md:98-103 has no kind for a failed update append, which current code reports as PermissionUpdateError::Failed (crates/dim-agent-capabilities/src/permission.rs:104-111); FileReads.md:79,86-88 has no kind for a failed compaction query, which current write_binding reports as HostError.
Failure scenario: a storage failure is reported asclosedorunknown, or cannot be reported, and callers retry or retire work when the correct next step is to report an owner failure.
Fix: add afailedor owner-specific kind for internal I/O and append failures, or state that these failures are reported as faults and the operation endsclosed; add a flow test for the path. -
ToolExecutor's gate row binding has no mechanism and no verification.
Problem: ToolExecutor.md:84 promises that gateId is bound to the calling row and that a call from another row isgate_closed, but OpenRequest carries onlyparentCallIdandcontext(ToolExecutor.md:164-167), InvokeRequest and CloseRequest carry onlygateId(177-192), and the verification list (112-118) has no cross-row test.
Failure scenario: any row holding a gate id can invoke a child tool through another line's parent call; the promised refusal cannot be implemented and no test would notice.
Fix: carry the caller row or context on invoke and close, or bind the gate to the caller's&Ctxat open; add a flow test for the refusal. -
ToolBinding.claim's context has no destination in the ToolRegistry contract.
Problem: ToolBinding.md:133,240-244 makescontexta field of ClaimRequest, but the ToolRegistry contract in #2103 definesclaim({request, calls}), while its claim callback takes a ToolExecutionContext. The current implementation passes the context to ToolHandler::claim (crates/dim-agent-capabilities/src/tool_binding.rs:246-253).
Failure scenario: ToolBinding cannot forward the context, so a contributor's claim loses the execution context or the registry contract must change silently.
Fix: addcontextto the registry's claim request and raise it on #2103, or drop it here and state how the contributor gets the context. -
FileReads keys bindings by canonical path, but its caller example looks up the display path.
Problem: FileReads.md:11 keys one binding per canonical path; the write example callsbindingwithdisplay.clone()(FileReads.md:37-38) but records withcanonical.clone()(49-52). The current code resolves the path before both the lookup and the record (crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:65-104).
Failure scenario: a write records the canonical path, the next write looks up the raw display path, the binding is missing, and the tool refuses withtext_binding_required, forcing a re-read.
Fix: pass the resolved path to both operations and state in the request table thatpathis canonical. -
FileReads' codec types do not cross as data.
Problem: FileReads.md:217 says TextEncoding, EncodingSource, Bom and Eol are existing codec types that cross as data, but those types have no serde derives (crates/dim-agent-capabilities/src/workspace_tools/file_reads.rs:24-59), and the existing TextFileBinding usesraw_revision: [u8; 32](line 62), while the appendix definesrevision: String(FileReads.md:170-176). The derived Serialize and Deserialize on the appendix type do not compile against the existing types.
Failure scenario: the binding appendix cannot produce the documented wire value, and the read result and the face would carry two different revision fields.
Fix: raise the serde and representation change as a requirement to the file-tools owner, or define DTOs here with an explicit mapping from the codec types. -
Published face signatures change without a compatibility statement.
Problem: backgroundExec is already a data face with positional methods (docs/architecture/rust-agent/plugins/WorkspaceTools.md:546-557); the target turns each into a request object (BackgroundExec.md:85-88) and replacesinvalidLimitwithinvalid_limit. approval and permission are also published faces (docs/architecture/rust-agent/plugins/Permission.md:24-26,343-345); the target changespendingfrom an array to{requests}anddecidefrom two arguments to a request object (Approval.md:81-82), and renamespermission.checktodecide(Permission.md:87).
Failure scenario: existing external clients call the old wire shapes and fail after delivery; the one-change rule cannot migrate callers outside the repository.
Fix: state whether the published faces keep their signatures with the new operations added, or whether the break is accepted and versioned; link the client migration. -
ToolBinding says Loop never calls the registry, contradicting its own example and the ToolRegistry contract.
Problem: ToolBinding.md:125 says Loop never calls the registry and line 207 says Loop calls this owner only, but the caller example callsregistry.declarations()(ToolBinding.md:52-53,76), and the ToolRegistry contract in #2103 assignsdeclarationsto Loop and the fingerprint.
Failure scenario: Loop implementers cannot tell where declarations come from, and the stated boundary is broken by the first example.
Fix: say that Loop calls ToolBinding for bind, claim and transfer and the registry only for declarations, or add a declarations operation to ToolBinding and update #2103.
P3
- Appendix examples and signatures do not compile together. FileReads.md:53 awaits
record, declared aspub fn recordat FileReads.md:213; ToolBinding.md:90 and 96 await the synctransferandadoptedand pass a&Stringtoadopted(String)(ToolBinding.md:270-272); ToolBinding.md:243 and ToolExecutor.md:164,211 use types they do not import. - Reply tables do not match the appendix returns: ToolExecutor.md:81 says
{result}but returns a bare ToolResult (211); Permission.md:88 says{version}but returns u64 (253); BackgroundExec.md:85-88 says{text}and{terminal}but returns String and ExecEndedData (226-229). A cross-language caller reading.text,.resultor.versiongets undefined. - BackgroundExec.md:125 says an unknown task is
unknownon every operation, butadoptreturnsunknown_task(BackgroundExec.md:84,96). Align the verification or the codes. - The README additions leave the index inconsistent: the six new branch parts are missing from the By scope table at README.md:62, and the Rules line (README.md:3) says design rules sections 1 and 4 while these contracts rely on section 7. Add the parts and link the section 7 source (PR #2029).
- The contracts are forward references to open PRs: every rule check cites section 7, which is in PR #2029, and the sibling contracts live in open PRs #2102, #2103, #2092, #2093 and #2094. Land the series together or label the links as targets and name the owning PRs in the text.
- PermissionRules is process scope in #2094, but Permission.md:77 labels it Session. Use
P:PermissionRulesand fix the ADR 002 D3 row in Permission.md:153. - ToolBinding.md:142,154 can leak an adoption on
already_boundand on any failure afterregistry.adopt: the flow adopts before inserting the record, and the table only releases adoptions at the row's unload. Check the record before adopting or release the adoption on the error path. - FileReads.md:187-192 can return a reply with both fields absent, so the caller's
.expect("one of binding or unavailable")(FileReads.md:44-45,61) can panic on a value from another language. Use an enum or make the unavailable case required.
|
|
||
| | Kind | Operation | What the caller does next | | ||
| | --- | --- | --- | | ||
| | `already_bound` | `bind` | A caller bug: the request id was bound twice. Fail the turn as a fault. | |
There was a problem hiding this comment.
The table names already_bound, invalid, unavailable and closed, but BindingError at ToolBinding.md:253-263 derives only Debug and Display. The rutis binding uses the serde form when the error implements Serialize, otherwise the Debug variant name, so the wire codes are AlreadyBound, Invalid, Unavailable and Closed. A cross-language caller matching the table never succeeds. Derive Serialize and Deserialize with the documented rename, or document the Debug names; apply the same fix to the other five contracts and reconcile invalidLimit and read in the existing backgroundExec face.
There was a problem hiding this comment.
Partially fixed: all six error enums now derive Serialize and Deserialize with snake_case and match their tables. Remaining: FileReads spells the unavailable value never_read at FileReads.md:79 while the appendix and the shared row use neverRead; the published faces' invalidLimit, read and Unknown still have no compatibility decision.
There was a problem hiding this comment.
Fixed in 038e60c. The six appendices now derive Serialize with #[serde(tag = "code", rename_all = "snake_case")] (for example ToolBinding.md:275-277); FileReads uses neverRead in the shared row (runtime-owner-operations.md:63) and the Unavailable enum (FileReads.md:221-233); and the client-visible sections record invalid_limit, read and the code case changes (BackgroundExec.md:124, Permission.md:119, Approval.md:115).
| | `B:Timeline`, `B:Dispatcher` | Reconcile the prefix's last configuration at branch opening; consume `step/tool-result` and `turn/end` for settlement; write nothing. | | ||
| | `B:BranchLifecycle` | Gate the registry-change watcher on activation and closing. | | ||
|
|
||
| The registry's `adopt`, `release`, `claim` and `release_claims` are called only by ToolBinding; Loop never calls the registry. |
There was a problem hiding this comment.
This contradicts the example above, which calls registry.declarations() (ToolBinding.md:52-53,76), and the ToolRegistry contract in #2103, which assigns declarations to Loop and the fingerprint. Say that Loop never calls the registry's adopt, release, claim or release_claims but does call declarations, or move declarations behind ToolBinding and update #2103.
There was a problem hiding this comment.
Still open: line 125 and line 214 still say Loop never calls the registry and calls this owner only, while the examples call registry.declarations() at lines 53 and 76.
There was a problem hiding this comment.
| pub struct ClaimRequest { | ||
| pub request_id: String, | ||
| pub calls: Vec<ToolCall>, | ||
| pub context: ToolExecutionContext, |
There was a problem hiding this comment.
context has no destination: the ToolRegistry contract in #2103 defines claim({request, calls}) without a context, while its claim callback takes a ToolExecutionContext. The current implementation passes the context to ToolHandler::claim (crates/dim-agent-capabilities/src/tool_binding.rs:246-253). Either add context to the registry's claim request or state how the contributor obtains it.
There was a problem hiding this comment.
Still open: ClaimRequest carries context (ToolBinding.md:248-252), but #2103's claim request is {request, calls} and its example passes only a rutis ctx; the contributor's claim callback gets no turn, request or branch data. The claim table also has no callback error for a registry claim refusal.
There was a problem hiding this comment.
Partially fixed in 038e60c. #2103 now carries context in ClaimCalls (ToolRegistry.md:108,309) and answers callback (ToolRegistry.md:124), and ToolBinding's claim and requirement state the context. Remaining: the refusal carries only cause.code and cause.message (ToolRegistry.md:218,245), while ToolBinding's Callback needs call_id (ToolBinding.md:154), and #2103's invalid claim error has no mapping in ToolBinding's claim table. See the new inline.
|
|
||
| | Operation | Normal path | Caller cancels | Caller unloads | Owner closes or reloads | Settled by | | ||
| | --- | --- | --- | --- | --- | --- | | ||
| | `bind` | Ask the registry to adopt the declarations, insert the record, release the adoptions of pins no later prefix declares | None: the call is synchronous and bounded | Nothing to release; the record is settled at the request's terminal fact or the close | A record in flight is refused with `closed`; the registry releases an adoption it granted at the row's unload | ToolBinding and ToolRegistry | |
There was a problem hiding this comment.
The flow adopts first and inserts the record second. If the insert fails with already_bound (ToolBinding.md:142), the new adoption is not released here; the table only notes that the registry releases at the row's unload, so the generation stays retained. Check the record before adopting or release the adoption on the error path.
There was a problem hiding this comment.
Still open: the flow still adopts before inserting the record and does not release the adoption on already_bound; the errors table only says to fail the turn.
There was a problem hiding this comment.
Fixed in 038e60c. The bind flow checks the record before adopting (ToolBinding.md:163), and the verification adds the second-bind case (ToolBinding.md:190).
| ToolExecutor reads the adoption once per call and hands it to the registry, which resolves the version's handler: | ||
|
|
||
| ```rust | ||
| let adopted = binding.adopted(&context.request_id).await?; // Invalid |
There was a problem hiding this comment.
adopted is declared pub fn adopted(&self, request_id: String) at ToolBinding.md:270, so this .await and the &String argument do not compile. The same mismatch appears at ToolBinding.md:90 for transfer, declared sync at ToolBinding.md:272. Align the signatures and the calls.
There was a problem hiding this comment.
Still open: adopted and transfer remain sync at ToolBinding.md:279-281 while this example and line 90 await them; adopted also takes String, not &String.
There was a problem hiding this comment.
Fixed in 038e60c. transfer and adopted are called without await and adopted takes an owned String (ToolBinding.md:96,102,114); the appendix declares both sync (lines 297,301).
|
|
||
| ```rust | ||
| let binding = reads.binding(BindingRequest { | ||
| path: display.clone(), |
There was a problem hiding this comment.
The owner keys bindings by canonical path (FileReads.md:11), but this lookup uses the raw display path while record uses canonical (FileReads.md:49-52). Current code resolves the path before both the lookup and the record (crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:65-104). A write would record a binding the next write cannot find, so the tool refuses with text_binding_required and forces a re-read. Pass the resolved path to both operations and document the request path as canonical.
There was a problem hiding this comment.
Still open: the lookup still uses display while record uses canonical (lines 38 and 50), and the request table does not say the path is canonical.
There was a problem hiding this comment.
Fixed in 038e60c. The example resolves once and passes canonical to both binding and record (FileReads.md:39-55), and the request table says the path is canonical (line 85).
| path: canonical.clone(), | ||
| binding: new_binding, | ||
| established, | ||
| }).await?; // Closed |
There was a problem hiding this comment.
record is declared pub fn record(&self, request: RecordRequest) -> Result<(), FileReadsError> at FileReads.md:213, so this .await does not compile. Make record async or remove the await and state that it is synchronous.
There was a problem hiding this comment.
Still open: record is still pub fn at FileReads.md:220 while this example awaits it.
There was a problem hiding this comment.
Fixed in 038e60c. The record example no longer awaits (FileReads.md:55), and the appendix declares pub fn record (line 258).
| | §4 rule 9 | No Timeline fact of its own; the bindings are a projection of public facts, and the projection is this owner's state. | | ||
| | §7 resources and objects | No resource; the owner stores values and returns values. | | ||
| | §7 no proxy | The owner answers its own bindings; it returns no file's bytes. | | ||
| | §7 one surface | `binding` and `record`; `get` and `write_binding` are removed. | |
There was a problem hiding this comment.
This removes operations that main still requires: docs/design/contracts/runtime-owner-operations.md:63 defines fileReads as binding({path}), writeBinding({path}) and record(...), and docs/design/service-faces.md:156-160 lists the positional backgroundExec methods. Update those contracts in this PR or raise the conflicting entries as requirements; otherwise delivery can follow either text.
There was a problem hiding this comment.
Fixed: runtime-owner-operations.md:63,76-77, service-faces.md:139-140,156 and session-boundary.md:391 now carry the new operations, and the Supersedes sections point at the replaced rows.
| } | ||
| ``` | ||
|
|
||
| `TextEncoding`, `EncodingSource`, `Bom` and `Eol` are the existing value types of the file-tool codec; they cross as data and stay defined beside the codec, not here. |
There was a problem hiding this comment.
These are not existing serde types: TextEncoding, EncodingSource, Bom and Eol derive only Debug, Clone, PartialEq and Eq (crates/dim-agent-capabilities/src/workspace_tools/file_reads.rs:24-59), and TextFileBinding uses raw_revision: [u8; 32] (line 62), not the appendix's revision: String. The appendix derives Serialize and Deserialize over types that do not implement them. Raise the serde and representation change as a requirement to the file-tools owner or define DTOs here with a mapping.
There was a problem hiding this comment.
Still open: TextEncoding, EncodingSource, Bom and Eol in crates/dim-agent-capabilities/src/workspace_tools/file_reads.rs:24-59 still have no serde derives, and TextFileBinding still uses raw_revision: [u8; 32] (line 62) against the appendix's revision: String.
There was a problem hiding this comment.
Partially fixed in 038e60c. The appendix now defines the DTOs, uses revision: String and encoding: String, and raises the codec mapping requirement (FileReads.md:157,174-242). Remaining: the requirement says the three enums use their snake-case names while the DTOs derive camelCase (lines 195-219), and the encoding labels differ from the codec's current utf8/utf16le labels (codec.rs:79-82). TextEncoding::Legacy also still cannot derive serde, so the "or derives serde on them" alternative does not work for it. See the inline.
|
|
||
| | Plugin | Process part | Session part | Branch part | Phase / issue | | ||
| | --- | --- | --- | --- | --- | | ||
| | [ToolBinding](ToolBinding.md) (owner contract) | — | — | a request's adopted tool set, its claims and its pins behind the `toolBinding` operations | [#2028](https://github.com/arcships/dim/issues/2028) | |
There was a problem hiding this comment.
The six new rows are branch parts, but the By scope table at README.md:62 still lists none of them, and the Rules line (README.md:3) says design rules sections 1 and 4 while these contracts rely on section 7. Add the parts to the branch row and link the section 7 source (PR #2029).
There was a problem hiding this comment.
Partially fixed: the By scope row now lists the six branch parts. The Rules line (README.md:3) still says sections 1 and 4 and does not link section 7, which the six contracts cite.
… rules Binding appendices: error enums serialize with snake_case codes matching the tables, caller: &Ctx on the row-bound operations, the advice callback is a direct parameter over defined request and answer types, and the examples match the signatures. Consistency: cancelled is defined per operation, BackgroundExec states one writer per command fact, and the README By scope lists the six branch parts. Supersedes sections and the existing documents' owner paragraphs replace the old shapes; line access follows ADR 027.
|
已按 /tmp/round3-rules.md 的 A–G 自查修改,head
|
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: This PR adds six branch-scope owner contracts for the tool chain (ToolBinding, ToolExecutor, Approval, Permission, BackgroundExec and FileReads), updates three shared contracts and the plugin index, and self-checks the set against the design rules. Refs #2028 and #2015.
Verdict: REQUEST_CHANGES
P1: none.
Round-1 status: of the ten P2 findings, one is fixed (the retained contracts), four are partially fixed (wire codes, Permission.advise, the ToolExecutor gate mechanism, the published-face supersession) and five remain open. Of the eight P3 findings, the README By scope table was fixed; the rest remain open, and the new sync advise adds another example/signature mismatch. The self-check's error-derive and supersession changes hold; its claim that the examples match the signatures does not.
P2
-
Owner-internal failures still have no error kind.
Problem: BackgroundExec.md:94-102 has no kind for a failed task-fact read, though the current face publishesread(docs/architecture/rust-agent/plugins/WorkspaceTools.md:549,566) and the implementation returns TaskError::Read, OutputPageError::Read and WaitError::Read (crates/dim-agent-capabilities/src/workspace_tools/background.rs:55-102). Approval.md:88-93 has no kind for a failedapproval/requestcommit, which current code maps tofailed(crates/dim-agent-capabilities/src/approval.rs:163-174). Permission.md:95-100 has no kind for a failed update append, which current code reports as PermissionUpdateError::Failed (crates/dim-agent-capabilities/src/permission.rs:104-111). FileReads.md:86-88 has onlyclosed, while write_binding returns HostError (crates/dim-agent-capabilities/src/workspace_tools/file_reads.rs:117).
Failure scenario: a storage or fact-read failure is reported asclosed,unknownor a denial, or cannot be reported at all; the caller retries or retires work when the correct next step is an owner failure.
Fix: add afailedor owner-specific kind and a flow test for each owner, or state that these failures are fault reports and name the operation's end state. -
ToolBinding.claim has no destination for its context and cannot report a refused claim.
Problem: ClaimRequest carriescontext(ToolBinding.md:133,248-252), but #2103's claim request is{request, calls}and its caller example passes only a rutisctx; nothing carries the turn, request and branch data to the contributor's claim callback. #2103's claim also returnscallbackwhen the contributor's claim callback refuses, while ToolBinding's claim errors are onlyinvalidandclosed(ToolBinding.md:133,145).
Failure scenario: a contributor whose claim needs the execution context cannot implement it, and a refused claim is lost or reported as a genericinvalid.
Fix: addcontextand the callback refusal to #2103's claim request and reply, or state the mapping here, and add the matching kind to ToolBinding's claim errors. -
FileReads keys bindings by canonical path but its example and request table use the display path.
Problem: the owner keys one binding per canonical path (FileReads.md:11), the write example looks up withdisplay.clone()(FileReads.md:37-38) and records withcanonical.clone()(49-52), and the request table (line 79) does not say the path is canonical. Current code resolves the path before both (crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:65-104).
Failure scenario: a write records a binding the next write cannot find; the tool refuses withtext_binding_requiredand forces a reread.
Fix: pass the resolved canonical path to both operations and state in the request table thatpathis canonical. -
FileReads' appendix types are not data.
Problem: FileReads.md:224 calls TextEncoding, EncodingSource, Bom and Eol "the existing value types" that "cross as data", but they derive only Debug, Clone, PartialEq and Eq (crates/dim-agent-capabilities/src/workspace_tools/file_reads.rs:24-59), and TextEncoding::Legacy holds a&'static encoding_rs::Encoding, which cannot derive Deserialize. TextFileBinding usesraw_revision: [u8; 32](line 62) while the appendix definesrevision: String(FileReads.md:176-182).
Failure scenario: the appendix does not compile against these types, and the read result and the face carry two different revision representations.
Fix: define DTOs here with an explicit mapping, or raise the serde and representation change as a requirement to the codec owner and state the wire revision as lowercase hex. -
Published faces change without a compatibility decision, and one value string still differs.
Problem: backgroundExec is published with positional methods and codesinvalidLimitandread(docs/architecture/rust-agent/plugins/WorkspaceTools.md:546-566); approval publishespending() -> ApprovalRequestData[]anddecide(requestId, decision)withUnknown,CancelledandClosed(docs/architecture/rust-agent/plugins/Permission.md:343-345); permission publishescheck(same file:24-26). The target replaces these shapes (BackgroundExec.md:84-88, Approval.md:78-82, Permission.md:84-87); the new Supersedes sections state which rows and pages they replace and say the implementation page keeps describing the implementation until the contract lands, but they do not say whether the published wire keeps its signature or the break is versioned. Separately, FileReads.md:79 spells the unavailable valuenever_read, while the appendix and runtime-owner-operations.md:63 useneverRead.
Failure scenario: existing clients call the old shapes and fail; a cross-language caller matchingnever_readnever matches.
Fix: state whether the published faces keep their signatures with new operations added or the break is accepted and versioned, link the client migration, and use one spelling for the unavailable value. -
ToolBinding still says Loop never calls the registry.
Problem: ToolBinding.md:18 and 125 say Loop drives bind, claim and transfer and never calls the registry; line 214 says Loop calls this owner only. The examples callregistry.declarations()(lines 53 and 76), and #2103 assigns declarations to Loop and the fingerprint.
Failure scenario: Loop implementers cannot tell where declarations come from, and the first caller example breaks the stated boundary.
Fix: say that Loop calls ToolBinding for the record and the registry only for declarations, or move declarations behind ToolBinding and update #2103. -
ToolExecutor.invoke treats cancellation as both an error and a result.
Problem: ToolExecutor.md:94 listscancelledas aninvokeerror and says "the child's result records the cancellation", while line 84 says a child call's refusal, cancellation or failure is a ToolResult withis_error: trueand line 109 says a child's failure is a result, not an operation error. The example comment at line 47 also omitsCancelled.
Failure scenario: a program or bridge cannot tell whether a cancelled invoke returnsErr(cancelled)orOk(ToolResult { is_error: true }), and the parent result can disagree with the thrown error.
Fix: separate the two cases. The caller's token endsinvokewithcancelled; the child's own cancellation is a result. Remove the "child's result records the cancellation" wording from the error row and update the example.
P3
-
Appendix examples still await sync operations. ToolBinding.md:90 and 96 await the sync
transferandadopted(ToolBinding.md:279-281); FileReads.md:49-53 awaits the syncrecord(FileReads.md:220); Permission.md:55 awaits the new syncadvise(Permission.md:270);adoptedalso takesString, not&String.
Failure scenario: the examples do not compile, and the self-check claim that they match the signatures is false.
Fix: make the operations async or remove the awaits and the reference. -
Reply tables still differ from the appendix returns. ToolExecutor.md:81 says
{result}but returns a bare ToolResult (line 222); Permission.md:85 says{version}but returnsu64(line 269); BackgroundExec.md:85-88 says{text}and{terminal}but returnsStringandExecEndedData(lines 236-239). A cross-language caller reading.result,.version,.textor.terminalgets undefined.
Fix: wrap the replies or document positional replies as the existing faces do. -
BackgroundExec verification says an unknown task is
unknownon every operation (BackgroundExec.md:132), butadoptanswersunknown_task(lines 84 and 96). Adjust the sentence or unify the code. -
Two appendix details: ToolBinding.md:148 says bind errors carry
name, while BindingError::Invalid carriesreason(line 267); Permission.md:100 tells the caller to withdraw the first registration, but no withdraw or release operation exists (lines 82-87). Align the fields and drop the withdrawal advice or add the operation. -
README and forward references. README.md:3 still says rules sections 1 and 4 and does not link section 7; the six contracts cite section 7, ADR 027 (PR #2029) and sibling contracts in open PRs #2092, #2093, #2094, #2102 and #2103. Land the series together or label every link as a target and name its owning PR.
-
PermissionRules is process scope in #2094, but Permission.md:74 labels it Session and the dependency table says
S:PermissionRules; the ADR 002 D3 row at line 155 says Session capabilities. UseP:PermissionRulesand process. -
ToolBinding.bind can leave an adoption behind. The flow adopts before inserting the record (ToolBinding.md:154), and the errors table only says to fail the turn on
already_bound(line 142). Check the record before adopting or release the adoption on the error path. -
FileReads' reply can carry neither
bindingnorunavailable(FileReads.md:193-198), so the caller's.expect(...)(lines 44-45 and 61) can panic on a value produced by another language. Use an enum or makeunavailablerequired. -
BackgroundExec recovery does not rebuild ended tasks. Line 14 writes failed terminals for unfinished commands, but no flow or verification says how a reloaded generation reconstructs ended tasks and their output paths. The current face answers historical
outputPage,waitandstopfrom task facts (docs/architecture/rust-agent/plugins/WorkspaceTools.md:549-557), and line 131 promises the preview in every state. State the rebuild or remove the historical promise.
| | `interrupted` | `open` | The turn was interrupted; stop the program. | | ||
| | `no_batch` | `open` | The parent call is not part of the current batch; a caller bug: stop the program and report it. | | ||
| | `gate_closed` | `invoke`, `close` | The gate's parent call settled or the batch was interrupted; stop the program; the parent result carries the effects already confirmed. | | ||
| | `cancelled` | `open`, `invoke` | The caller's token ended the call; for `invoke` the child's result records the cancellation and the gate stays usable. | |
There was a problem hiding this comment.
invoke now has a cancelled error, but line 84 says a child call's refusal, cancellation or failure is a ToolResult with is_error: true, and line 109 says a child's failure is a result, not an operation error. A program or bridge cannot tell whether a cancelled invoke returns Err(cancelled) or Ok(ToolResult { is_error: true }), and the parent result and the thrown error can disagree. Separate the two cases: the caller's token ends invoke with cancelled, while the child's own cancellation is a result. Update the example comment at line 47 too.
There was a problem hiding this comment.
Fixed in 038e60c. The operation table and errors now say the caller's token ends invoke with cancelled, while the child's own cancellation is a ToolResult (ToolExecutor.md:83,88,98,107,130), and the example comment includes Cancelled (line 49).
| | --- | --- | --- | --- | --- | --- | | ||
| | `bind` | Fix a request to one adopted generation | `{requestId, turnId, through, declared, sources}` | `{}` | None; the owner completes the adoption and the record | `already_bound`, `invalid` (the registry refused the declarations), `unavailable` (a source version is gone), `closed` | | ||
| | `adopted` | The record's adoption id and declarations | `{requestId}` | `{adoption, tools}` | None | `invalid` (no record), `closed` | | ||
| | `claim` | Register the calls' claims before their batch fact | `{requestId, calls, context}` | `{}` | None | `invalid` (no record), `closed` | |
There was a problem hiding this comment.
claim carries context and has no callback error. #2103's claim request is {request, calls} and its caller example passes only a rutis ctx, so the contributor's claim callback gets no turn, request or branch data. #2103's claim also returns callback when the contributor's claim callback refuses, while this table has only invalid and closed. Add context and the refusal to #2103's claim request and reply, or state the mapping here, and add the matching error kind.
There was a problem hiding this comment.
Partially fixed in 038e60c. #2103 now carries context in ClaimCalls and answers callback (ToolRegistry.md:108,124,309), so the context part is fixed. Remaining: the refusal has no call id, and ToolBinding's Callback requires one; #2103's invalid also has no mapping here. See the reply on the line 265 thread and the new inline.
| | `invalid` | `adopted`, `claim`, `transfer` | The request has no record: a caller bug or a request released before its batch. Fail the turn as a fault. | | ||
| | `closed` | any | The branch is closing or unloading; the turn ends. | | ||
|
|
||
| `bind` errors carry the declaration that failed (`name`) or the source that is gone (`key`, `version`); the owner reports no failure the record cannot have. |
There was a problem hiding this comment.
bind errors are documented as carrying the failed declaration's name, but BindingError::Invalid carries reason (line 267) and Unavailable carries key and version. A cross-language caller reading the documented name gets nothing. Add name to Invalid or change this sentence to the fields the appendix carries.
There was a problem hiding this comment.
Fixed in 038e60c. Invalid now carries name and reason (ToolBinding.md:280-281), and the error table says the error names the declaration and the reason (line 151). New sourcing issue: #2103's adopt error still carries only a message, so the name cannot be filled from the registry; see the inline on line 157.
| | `cancelled` | `decide` | The call's batch was cancelled; do not run the call. | | ||
| | `closed` | any | The generation is closing or reloading; stop; a later generation serves. | | ||
| | `conflict` | `update` | Re-read the version from `PermissionState` and decide whether to retry the update with the new base. | | ||
| | `duplicate` | `advise` | The name is taken; pick another or withdraw the first registration. | |
There was a problem hiding this comment.
The duplicate row tells the caller to withdraw the first registration, but the contract has no withdraw or release operation: the operations are decide, update, advise and the published value (lines 82-87), and the flow says only the calling row's unload withdraws a registration (line 110). A caller that hits duplicate can only unload its part. Drop the withdrawal advice or add a release operation.
There was a problem hiding this comment.
Fixed in 038e60c. The duplicate row now says to choose another name and that the registration stays until the row unloads (Permission.md:100); the withdrawal advice is gone.
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub binding: Option<TextFileBinding>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub unavailable: Option<Unavailable>, |
There was a problem hiding this comment.
Both fields are optional with skip_serializing_if, so a serialized reply can carry neither binding nor unavailable. The caller then panics on binding.unavailable.expect(...) (lines 44-45 and 61), so a foreign implementation or a partial value turns a refusal into a panic. Make the reply an enum, or make unavailable present whenever binding is absent.
There was a problem hiding this comment.
Fixed in 038e60c. BindingReply is an enum with Bound and Unavailable variants (FileReads.md:228-233), the caller example matches the variants, and the shared row is updated (runtime-owner-operations.md:63).
| - **The task table.** One task per background command of the line: the task id, its description and title, the registered output path, the process it supervises, and its terminal record. | ||
| - **Supervision.** Wait for the process the host started, write `exec/ended` with its status and result, hold the Session until the terminal fact is appended, and wake the line with a bounded notice unless the end came from a stop, a branch close or an unload. | ||
| - **The output artifact.** The task's registered output file: the tail preview and its bounded pages, the truncation flag, and the unavailable answer when the file is gone. The bytes are appended by the process; the artifact reference and every read belong to this owner. | ||
| - **Recovery.** On load, write failed terminals for commands whose process did not survive, and post the wakes the previous generation lost. |
There was a problem hiding this comment.
Recovery writes failed terminals for unfinished commands, but the contract never says how a reloaded generation rebuilds ended tasks or their registered output paths. The current face answers historical outputPage, wait and stop calls from task facts (docs/architecture/rust-agent/plugins/WorkspaceTools.md:549-557), and the verification promises the preview in every state of the task (line 131). State the rebuild or remove the historical read promise.
There was a problem hiding this comment.
Partially fixed in 038e60c. The task table and load flow now rebuild ended tasks from the facts (BackgroundExec.md:11,117,132,145-146). Remaining: the verification at line 147 still promises the tail preview in every state, while output is unknown for an ended task (lines 86,98,113,125); see the inline.
|
|
||
| | Operation | Intent | Request | Reply | Cancellation | Errors | | ||
| | --- | --- | --- | --- | --- | --- | | ||
| | `binding` | Whether a file may be replaced or edited, and on which binding | `{path, purpose}` | `{binding?}` or `{unavailable: never_read\|compacted}` | None; the owner completes the read | `closed` | |
There was a problem hiding this comment.
The unavailable value is never_read here, but the appendix's Unavailable uses #[serde(rename_all = "camelCase")] and serializes neverRead (lines 184-189), and the updated shared row in docs/design/contracts/runtime-owner-operations.md:63 also uses neverRead. A cross-language caller matching never_read never matches. Use one spelling in the table, the appendix and the shared row.
There was a problem hiding this comment.
Fixed in 038e60c. The operations table uses BindingReply, the Unavailable enum serializes neverRead (FileReads.md:221-233), and the shared row uses neverRead (runtime-owner-operations.md:63).
Owner failures get kinds (read, failed); claim carries its execution context and reports the contributor's refusal; FileReads keys by canonical path and defines wire DTOs; published faces keep their shapes or state the break in Client-visible changes; Loop gets declarations from the registry and ToolBinding provides the operations Loop requires; invoke separates the caller's cancellation from the child's result; examples, replies, recovery and the superseded documents follow.
|
已按评审与自查标准修改,head 评审逐条处理
自查额外修改(第 1–3 节)
客户端可见变更
已重新请 |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: This PR adds six branch-scope owner contracts for the tool chain (ToolBinding, ToolExecutor, Approval, Permission, BackgroundExec and FileReads), updates the shared contracts and the plugin index, and aligns Hooks with the target operation names. Refs #2028 and #2015.
Verdict: REQUEST_CHANGES
Round-2 status: fixed in this head are the owner failure kinds, the FileReads canonical path, the record signature, the BindingReply enum and neverRead, the BackgroundExec read kind and rebuild flow, the PermissionRules scope, the README scope row and section 7 link, the bind record check, the sync examples, the ToolExecutor reply and cancellation split, the Approval failed kind, and the bind error name field. Partially fixed: claim context (now in #2103; the call id is not), published-face compatibility (sections added, the Approval bullet is wrong), the FileReads codec mapping (DTOs added, the wire names contradict), Permission.advise (input is data, the callback remains on the face) and BackgroundExec recovery (rebuild added, the preview promise remains). New in this head: release and retain_only are branch-facing while the shared contracts do not have them, and the ToolRegistry declaration and error shapes do not match.
P2
-
ToolBinding adds release and retain_only that the shared contracts do not have.
Problem: ToolBinding.md:18 says Loop callsbind,claim,transfer,retain_onlyandrelease, and the operations table addsreleaseandretain_only(lines 140-141). The shared row this PR updates lists onlybind,adopted,claimandtransferand says the record is settled from facts (runtime-owner-operations.md:76). PR #2102 at 851f531 has the same four in its dependencies (Loop.md:67) and says "the Loop calls no release or retain operation" (Loop.md:145). The appendix returns()for both (ToolBinding.md:299-300) while the table gives them aclosederror (140-141).
Failure scenario: an implementer following #2102 never calls the two operations, so the rebuild and budget-recovery paths keep stale records and claims until close; one following this table calls operations the shared contracts do not define, and the delivery task can skip the caller migration. A caller matching the table'sclosedonreleasehas no error to match.
Evidence: ToolBinding.md:18,140-141,166-167,176,299-300; runtime-owner-operations.md:76; PR #2102 Loop.md:67,145. Current Loop code already calls both (crates/dim-agent-capabilities/src/agent_loop.rs:1190,1458,1664-1760), so the shared contracts are the likely side to update.
Fix: pick one. If the operations stay, add them to #2102 and the shared row and returnResultfor the documentedclosed. If they do not, remove the two rows and keep settlement from the facts. -
ToolBinding's ToolRegistry interface does not match #2103.
Problem: three shapes disagree with PR #2103 at 734d364. First,registry.declarations()is called synchronously at ToolBinding.md:58 and 82, while #2103 declarespub async fn declarationsand awaits it (ToolRegistry.md:82,340). Second,binderrors carry a declarationnameor akey/version(ToolBinding.md:151-157,280-283), while #2103'sadoptrefuses withToolError::Invalid { message }orUnavailable { message }(ToolRegistry.md:122-124,212-219). Third,claim's refusal carries the call id (ToolBinding.md:154), while #2103'sToolError::Callbackhas onlycause.codeandcause.message(ToolRegistry.md:108,124,218,245), and #2103'sinvalidclaim error has no mapping in ToolBinding's claim table (ToolBinding.md:139,153).
Failure scenario: the bind and claim samples do not compile against #2103; a bind refusal cannot name the failed declaration or source; a batch with one claim refusal cannot identify the call, so the turn fault loses it; a registryinvalidclaim has no defined end state.
Evidence: ToolBinding.md:58,82,151-157,280-283; PR #2103 ToolRegistry.md:82,108,122-124,212-219,245,340.
Fix: align one contract with the other. Restore.await?; add structuredname/key/versionand the call id to #2103's errors, or drop them fromBindingErrorand state what callers receive; mapinvalid. -
Permission.advise is still a Rust callback on the data face.
Problem:adviseis an operation in the table (Permission.md:85) and in service-faces.md:140, and the appendix puts it in the#[rutis::service]impl withAdviseFn = Arc<dyn Fn...>and no#[service(skip)](Permission.md:258-262,285). The section 7 cross-language row says every parameter and reply is data (line 162). The new exception cites section 7's callback-by-reference allowance (line 124), but section 7 also requires the public face to be cross-language and keeps Rust-only methods inside the owner (PR #2029 principles.md:123,131). Current code marksregister_advice#[service(skip)](crates/dim-agent-capabilities/src/permission.rs:237-238).
Failure scenario: a non-Rust branch part cannot register an advisor; if the callback goes on the wire, it cannot cross; removing the current skip in delivery either breaks the face or leaves a Rust-only method on a face the rule check calls cross-language.
Evidence: Permission.md:85,124,162,258-262,285; service-faces.md:140; PR #2029 principles.md:123,131; permission.rs:237-238.
Fix: keepadviseoff the data face with#[service(skip)]and state that it is Rust-only and private, or define a data registration plus a bridge route and keep the rule check true. -
FileReads' codec mapping contradicts itself.
Problem: the requirement says the three enums use "their snake-case names" (FileReads.md:157), while the DTOs derive camelCase (lines 195-219,utf8Policy,utf16Le). The encoding comment saysutf-8,utf-16le,utf-16be(lines 187-189), while the codec's current labels areutf8,utf16le,utf16be(crates/dim-agent-capabilities/src/workspace_tools/files/codec.rs:79-82) andutf8-policy(line 287).
Failure scenario: the codec owner maps toutf8_policywhile the DTO emitsutf8Policy, or toutf-8while the read result emitsutf8; a cross-language caller matching one spelling never matches the other, and the encoding fidelity check compares different strings.
Evidence: FileReads.md:157,187-189,195-219; codec.rs:79-82,287.
Fix: state one set of wire values, probably the appendix's camelCase, and either keep the codec's current labels or record the change; align the requirement sentence and the DTO comments.
P3
-
BackgroundExec.md:147 still promises "The tail preview and the pages read the artifact in every state of the task", while
outputisunknownfor an ended task (lines 86, 98, 113, 125). Fix: say "the pages read the artifact in every state; the tail preview only while the task runs." An acceptance test written from this line otherwise expects a preview after the task ends. -
FileReads.md:46 uses
BindingReply::Unavailable(reason)while the variant isUnavailable { reason }(line 232); the second example at line 64 uses the struct form. Fix the first pattern. -
Approval.md:113 says
respond(requestId, decision)is renameddecide, but the published face already exposesdecide(docs/architecture/rust-agent/plugins/Permission.md:337-345) andrespondis the#[service(skip)]method (crates/dim-agent-capabilities/src/approval.rs:330-331);decidedelegates to it at approval.rs:91. Say thatrespondis removed,decidestays andadmitis added. -
Approval.md:168 says ADR 027 is not applicable while the same sentence says the Collaboration route reaches the line's pending approvals. That route is the ADR 027 D3 data-face path (runtime-owner-operations.md:26; PR #2029 ADR 027 D3). Say D3 or drop the claim. The BackgroundExec and FileReads rows describe the same D3 route correctly; no D5 lease citation is needed because their Session hold is #2093's lease.
-
ToolExecutor.md:131-132 still has no cross-row test: the contract says a call from another row is
gate_closed(line 86) andopen,invokeandclosetakecaller: &Ctx(lines 229-231), but the verification only covers a parent call outside the batch and a settled gate. Add the call from a second row.
Cross-PR and verification
- PR #2101 rewrites Hooks.md and edits README.md and service-faces.md, which this PR also edits; #2101 already cites
Permission.adviseandApproval.decideas pending #2100. Coordinate the landing order and expect a textual conflict. #2097, #2098 and #2099 also touch the same index files. - Sibling heads checked: #2102 851f531, #2103 734d364, #2093 a4f2377, #2094 8ef2691, #2029 da6f4a9.
- Main is 6e86d48, merge base 5a279d6.
node scripts/adr-check.mjs --base 5a279d69passed. CI:ci-okandchangespass; the other jobs are skipped for a docs-only change. The merge state is BLOCKED by this review. - Prior opinions withdrawn: the wire-code, canonical-path,
BindingReply, record-await,readkind,unknown_task, README, PermissionRules, bind-leak, ToolExecutor reply, ToolExecutor cancellation and Approvalfailedfindings are fixed and should not be repeated. The claim-context finding narrows to the call id and the missinginvalidmapping.
|
|
||
| ToolBinding does not execute tools, decide admission, hold a handler or a claim guard. The registry's `adopt`/`release`, `claim`/`release_claims` are the Session-side capability ToolBinding requests; execution, write-target resolution and ordering class belong to the registry's `run`, `resolve_write` and `ordering`. The adopted configuration fact (`context/configured`'s tool part) belongs to Prompt. | ||
|
|
||
| Loop calls ToolBinding for the request record (`bind`, `claim`, `transfer`, `retain_only`, `release`) and calls the registry only for `declarations`, which answers the current host and contributed declarations; that read is the fingerprint's too, and no adoption or claim goes through it. |
There was a problem hiding this comment.
release and retain_only are new branch-facing operations here, but #2102 at 851f531 lists only bind, adopted, claim and transfer (Loop.md:67) and says "the Loop calls no release or retain operation" (Loop.md:145); the shared row this PR updates also lists only the four and fact settlement (runtime-owner-operations.md:76). The appendix returns () for both (ToolBinding.md:299-300) while the table gives them a closed error (140-141). Failure: an implementer following #2102 leaves stale records or claims on rebuild and budget recovery; one following this table calls operations the shared contracts do not define, and a caller cannot match the documented closed. Fix: add both to #2102 and the shared row and return Result for the documented error, or remove the two rows and keep settlement from the facts. Current code calls both (agent_loop.rs:1190,1458,1664-1760), so the shared contracts are the likely side to update.
| }).await?, // AlreadyBound, Invalid, Unavailable, Closed | ||
| None => { | ||
| // No tool part: declare the registry's current host and contributed tools. | ||
| let current = registry.declarations()?; |
There was a problem hiding this comment.
#2103 at 734d364 declares pub async fn declarations (ToolRegistry.md:340) and awaits it in its own example (ToolRegistry.md:82). This call and the one at line 82 omit .await, so the samples do not compile against the sibling contract and current.tools is read from a future. Failure: an implementer copying the sample gets a type error, or changes #2103 to sync to make it compile. Fix: restore .await? in both samples, or change #2103 and state the async boundary.
| | `invalid` | `bind` | No | The registry refused the declarations; the error names the declaration and the reason; fail the turn and report them. | | ||
| | `unavailable` | `bind` | Yes, after re-preparing | The prefix declares a source version the registry no longer retains; re-prepare from the current declarations, or fail the turn. | | ||
| | `no_record` | `adopted`, `claim`, `transfer` | No | The request has no record: a caller bug or a request released before its batch; fail the turn as a fault. A reload settlement is not this error. | | ||
| | `callback` | `claim` | Depends on the cause | The contributor's claim callback refused; the error carries the call id, and the callback's own code in `reason` and its message in `message`. The batch is not published; the turn fails unless the cause says the call may be retried in a later request. | |
There was a problem hiding this comment.
Callback { call_id, ... } requires the call id, but #2103's claim refusal is ToolError::Callback { cause: ToolCallbackError } with only code and message (ToolRegistry.md:218,245), and its claim reply carries only the claimed ids (ToolRegistry.md:108). A batch with one refusal cannot name the call. The requirement at line 227 asks #2103 only for the context and the code/message, so the sibling contract does not supply the field. Failure: the turn fault loses which call refused, and the caller cannot report or retry that call. Fix: add the call id to #2103's claim refusal or drop call_id from this error and define how the refusing call is identified. Also map #2103's invalid claim error: this table has no entry for it.
There was a problem hiding this comment.
Still open. #2103's ToolError::Callback carries only cause.code and cause.message (ToolRegistry.md:218,245), and claim answers only the claimed ids on success (line 108); ToolBinding.md:154 and 287 require call_id. #2103's invalid claim error (line 122) also has no mapping. See the inline on line 154.
| | `callback` | `claim` | Depends on the cause | The contributor's claim callback refused; the error carries the call id, and the callback's own code in `reason` and its message in `message`. The batch is not published; the turn fails unless the cause says the call may be retried in a later request. | | ||
| | `closed` | any | No, in this generation | The branch is closing or reloading; the turn ends; a replacement generation serves the next request. | | ||
|
|
||
| `bind` errors carry the declaration that failed (`name`) or the source that is gone (`key`, `version`); the owner reports no failure the record cannot have. |
There was a problem hiding this comment.
bind errors are documented with name for invalid and key/version for unavailable, and the appendix encodes them (lines 280-283). #2103's adopt refusal is ToolError::Invalid { message } and Unavailable { message } (ToolRegistry.md:122-124,212-219), with no structured fields. Failure: ToolBinding cannot populate its own error; a cross-language caller reading name or key gets nothing and must parse a message. Fix: add the fields to #2103's adopt errors, or narrow this error to what the registry returns and say so here and in the requirement at line 227.
There was a problem hiding this comment.
Still open. #2103's adopt refuses with Invalid { message } and Unavailable { message } (ToolRegistry.md:212-219), so ToolBinding cannot fill the name/key/version fields at ToolBinding.md:157 and 281-283. See the inline on line 157.
| | §7 resources and objects | No resource; no object crosses. Advice is a callback by reference. | | ||
| | §7 no proxy | The owner answers its own decision and publishes its own state. | | ||
| | §7 one surface | `decide`, `update`, `advise`, and the published value; `admit_decision`, `check` and the separate `decide` are removed. | | ||
| | §7 cross-language | Every parameter and reply is data; the decision is a value, not an error. | |
There was a problem hiding this comment.
This row is false while advise stays on the same face with an Arc<dyn Fn> argument (lines 85, 258-262, 285). Section 7 allows callbacks by reference as values (PR #2029 principles.md:123), but it also requires the public face to be cross-language and keeps Rust-only methods inside the owner (principles.md:131); the current code marks register_advice #[service(skip)] (crates/dim-agent-capabilities/src/permission.rs:237-238), and service-faces.md:140 lists advise on the data face. Failure: a non-Rust branch part cannot register an advisor; if the callback goes on the wire it cannot cross; delivery removes the current skip without a bridge. Fix: mark it skip and state that it is Rust-only and private, or define a data registration plus a bridge route.
There was a problem hiding this comment.
Withdrawn. rutis 0.23.0 supports a function parameter on a #[rutis::service] method (FromFunction), and service-faces section 1 rule 4 allows callbacks by reference, so the advisor can cross languages and the target's exception at Permission.md:124 is accurate. The only remainder is the optional wording at Permission.md:162; see the new inline.
| ## Requirements raised to mechanism owners | ||
|
|
||
| - **Cross-scope access ([ADR 027](https://github.com/arcships/dim/pull/2029), [#2127](https://github.com/arcships/dim/issues/2127), target).** A Session part reaches a line's data face by line id with `line_owner::<T>(line)`. The file tools use it to reach `binding` and `record`; FileReads adds no forwarding operation. | ||
| - **File-tool codec ([#2103](https://github.com/arcships/dim/pull/2103), target).** The codec's `TextEncoding`, `EncodingSource`, `Bom`, `Eol` and `TextFileBinding` are not wire data (`TextEncoding::Legacy` holds an `encoding_rs` reference and `raw_revision` is `[u8; 32]`). The codec owner provides the mapping to the DTOs below: the encoding label (`utf-8`, `utf-16le`, `utf-16be`, or the requested legacy name lowercased), the revision as lowercase hex, and the three enums as their snake-case names; or derives serde on them with the same wire values. This owner does not change the codec. |
There was a problem hiding this comment.
The mapping sentence and the appendix disagree on the wire values. This line asks for "the three enums as their snake-case names" (utf8_policy, utf16_le), while the appendix derives camelCase (lines 195-219, utf8Policy, utf16Le). The encoding comment says utf-8/utf-16le/utf-16be (lines 187-189), while the codec's current labels are utf8/utf16le/utf16be (crates/dim-agent-capabilities/src/workspace_tools/files/codec.rs:79-82) and utf8-policy (line 287). The codec owner cannot satisfy both, and a cross-language caller matching either never matches the other. Failure: the mapping ships one spelling and the DTO another; encoding fidelity checks compare different strings. Fix: state one set of values, probably the appendix's camelCase, and either keep the codec's current labels or record the change; align the requirement and the DTO comments.
There was a problem hiding this comment.
Fixed in 437266b. The requirement now uses the codec's utf8, utf16le and utf16be labels, maps utf8-policy to utf8Policy, and the DTOs derive camelCase; the shared row uses neverRead.
| - A command moved to the background ends once, its terminal is written once, and the line wakes once; a stop cancels it without a wake; a branch close cancels it without a wake. | ||
| - A reload writes failed terminals for unfinished commands, rebuilds every ended task with its output path, posts the wakes the previous generation lost, and refuses a new adoption; a Session close settles the hold. | ||
| - A historical task answers `output_page` and `stop` after a reload; `output` is `unknown` for it; `wait` answers its terminal at once. | ||
| - The tail preview and the pages read the artifact in every state of the task; a page's cursor advances by its bytes; a limit of zero is `invalid_limit`; a deleted file is `unavailable`; a failed task-fact read is `read`. |
There was a problem hiding this comment.
output is unknown for an ended task (lines 86, 98, 113, 125), but this verification still promises the tail preview in every state. The two cannot both pass. Failure: an acceptance test written from this line expects a preview after the task ends; the implementation either fails the test or re-adds the historical preview the contract removed. Fix: say "the pages read the artifact in every state; the tail preview only while the task runs."
There was a problem hiding this comment.
Fixed in 437266b. The verification now says the pages read in every state and the tail preview only while the task runs (BackgroundExec.md:145).
| }).await?; // Closed, Failed | ||
| match binding { | ||
| BindingReply::Bound(binding) => { /* preserve encoding and line endings; check the revision */ } | ||
| BindingReply::Unavailable(reason) => { |
There was a problem hiding this comment.
The reply is a struct variant, BindingReply::Unavailable { reason: Unavailable } (line 232), so this tuple pattern does not compile; the second example at line 64 uses the struct form. Failure: a reader copying the first example gets a pattern type error. Fix: use BindingReply::Unavailable { reason }.
There was a problem hiding this comment.
Partially fixed in 437266b. The first example now uses BindingReply::Bound { binding } (FileReads.md:45); the edit example at FileReads.md:63 still uses BindingReply::Bound(binding). See the inline on line 63.
|
|
||
| The published `approval` face ([Permission plugin page](../../architecture/rust-agent/plugins/Permission.md#approval-data-face)) keeps `pending()` and `decide(requestId, decision)` positionally and keeps `ApprovalRequestData[]` as `pending`'s reply. It changes as follows, and the maintainer is asked to confirm: | ||
|
|
||
| - `respond(requestId, decision)` is renamed `decide`; the callers are Hooks and the App Server's `approval.respond` built-in. The built-in keeps its name and settles through this operation; the client RPC is unchanged. |
There was a problem hiding this comment.
The published approval face already exposes decide (docs/architecture/rust-agent/plugins/Permission.md:337-345), and respond is the Rust-only method marked #[service(skip)] (crates/dim-agent-capabilities/src/approval.rs:330-331); decide delegates to it at approval.rs:91. So respond is not renamed to decide; it is removed, and decide stays. Failure: a delivery task renames respond to decide and collides with the existing method, or migrates Hooks as if the face name changed. Fix: say that respond is removed as a Rust-only method, decide is unchanged on the face and admit is the added operation.
There was a problem hiding this comment.
Fixed in Approval.md:113. The same claim remains in Hooks.md:26, which says the target renames respond to decide; Hooks.md:504 and 589 also use lowercase duplicate, unknown, failed and closed. See the inline on Hooks.md:26.
| | ADR 002 D3 | Depends on Permission (branch) and the branch infrastructure. | | ||
| | ADR 002 D4 | No configuration. | | ||
| | ADR 002 D5 | Language-neutral operations and data. | | ||
| | ADR 027 | Not applicable: the line's own part serves its callers; the Collaboration route uses the line access owned by ADR 027. | |
There was a problem hiding this comment.
Not applicable contradicts the same sentence: the Collaboration route reaches a member line's pending/decide by line id, which is ADR 027 D1/D3 (runtime-owner-operations.md:26; PR #2029 ADR 027 D3). A reader cannot tell whether Approval must be a resolvable data face. Failure: delivery treats approval as not cross-scope and leaves it unreachable by id. Fix: cite D3 and state the route, or remove the route claim.
Keep the published approval, permission and backgroundExec codes with their faces; remove the Rust-only respond method instead of renaming it; state the advise callback as a FromFunction value; align the FileReads DTO values with the codec labels; add the cross-row gate test; make the background tail preview state its live-only promise; return Result from release and retain_only.
|
已按评审修改,head 评审逐条(针对 head 038e60c 的新 inline)
自查发现(第 1–9 条)
left for step 2(跨 PR,先不改)
已重新请 |
|
已按评审修改,head 跨 PR 对齐:
验证: |
|
补充说明,head
验证: |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope: This PR adds six branch-scope owner contracts for the tool chain (ToolBinding, ToolExecutor, Approval, Permission, BackgroundExec and FileReads), updates the shared contracts and the plugin index, and aligns Hooks with the target operation names. Refs #2028 and #2015.
Verdict: REQUEST_CHANGES
Round-3 status: fixed in 437266b are the release/retain_only gap, the FileReads codec mapping, the BackgroundExec preview promise, the Approval ADR 027 row and the ToolExecutor cross-row test. The ToolRegistry mismatch remains. The Permission.advise P2 is withdrawn: rutis 0.23.0 supports a function parameter on a #[rutis::service] method (FromFunction), and service-faces section 1 rule 4 allows callbacks by reference, so the advisor can cross and the target's exception is accurate. The FileReads pattern is fixed at line 45 but remains at line 63. The Approval rename is fixed in Approval.md but remains in Hooks.md.
P2
-
ToolBinding's ToolRegistry interface still does not match #2103.
Problem: three shapes disagree with PR #2103 at 59a77a3. First, ToolBinding.md:58 and 82 callregistry.declarations()synchronously, while #2103 declarespub async fn declarationsand awaits it (ToolRegistry.md:82,340). Second,binderrors carry a declarationnameor akey/version(ToolBinding.md:157,281-283), while #2103'sadoptrefuses withToolError::Invalid { message }orUnavailable { message }(ToolRegistry.md:122-124,212-219). Third,claim's refusal carries the call id (ToolBinding.md:154,287), while #2103'sToolError::Callbackhas onlycause.codeandcause.message(ToolRegistry.md:108,124,218,245); #2103'sinvalidclaim error has no mapping in ToolBinding's claim table (ToolBinding.md:153).
Failure scenario: the samples do not compile against #2103; a bind refusal cannot name the failed declaration or source without parsing a message; a batch with one claim refusal cannot identify the call, so the turn fault loses it; a registryinvalidclaim has no defined end state.
Evidence: ToolBinding.md:58,82,153-157,281-287; PR #2103 ToolRegistry.md:82,108,122-124,212-219,245,340.
Fix: align one contract with the other. Restore.await?in both samples. Add structuredname/key/versionand the call id to #2103's errors and mapinvalid, or drop those fields fromBindingErrorand state what callers receive. -
Hooks.md contradicts the owner contracts on the target operation and its codes.
Problem: Hooks.md:26 says the target "renames the operation toapproval.decide", but Approval.md:113 saysrespondis removed as the Rust-only skip method anddecideis already the face's operation. Hooks.md:589 spells the decide errorsunknown,failedandclosedagainst the PascalCase enum at Approval.md:194-195, and Hooks.md:504 spells the advisor duplicateduplicateagainst Permission.md:100Duplicate.
Failure scenario: a delivery task following Hooks renamesApproval::respondtodecideand collides with the existingdecide(crates/dim-agent-capabilities/src/approval.rs:91); a cross-language caller matching the lowercase codes never matches the owner's wire codes.
Evidence: Hooks.md:26,504,589; Approval.md:113,194-195; Permission.md:100; approval.rs:91.
Fix: sayrespondis removed anddecideis unchanged, and useUnknown,Failed,ClosedandDuplicate. Since #2101 at 18d5e4f rewrites Hooks.md, dropping these Hooks edits from this PR is the simpler fix. The earlier rounds checked Approval.md's wording; Hooks.md kept the same claim and now contradicts the corrected owner contract.
P3, optional
-
FileReads.md:63 matches
BindingReply::Bound(binding)against the struct variantBound { binding: TextFileBinding }declared at FileReads.md:230-231. The first example at line 45 uses the struct form. Copying the edit example gets a pattern type error. Fix:BindingReply::Bound { binding } => binding. -
runtime-owner-operations.md:26,48,63,76 and 77 use full-width Chinese parentheses in an English document. Fix: use ASCII parentheses.
-
README.md:3 says section 7 is "target, pending #2029", but #2029 merged at 4d081fe and is on current main. The same PR link appears at Approval.md:168, BackgroundExec.md:17, FileReads.md:18,76,156, runtime-owner-operations.md:26 and background-task-output.md:74. Fix: link docs/adr/027-cross-scope-access-by-id.md and the principles section 7 anchor, and drop the pending label.
-
Approval.md:93 says
unknownand line 103 saysclosedwhile the error kinds and the appendix use PascalCase (Unknown,Closed). A migration reader matching the backticked strings can miss the wire codes. Fix: useUnknownandClosedin both sentences. -
Permission.md:162 says every parameter and reply is data, but
advisetakes a callback by reference (line 124), and the request column at line 85 listscaller: &Ctxwhile line 181 says the caller is not a request field. This is the only issue left from the withdrawn P2. Fix: say data or a callback by reference (service-faces section 1 rule 4), and show the request as{name, callback}with the caller noted separately. -
Approval.md removes the Rust-only
respondandreplaybut no longer names their App Server callers. Current code callsApproval::respondat crates/dim-app-server/src/approval.rs:24 and crates/dim-app-server/src/collaboration/approvals.rs:162,342,707, andApproval::replayat approval.rs:39 and collaboration/approvals.rs:642. The client methodapproval.respondstays, so these sites must move todecideandpending. Fix: state the migration so the skip methods can be removed in one change.
Cross-PR and conflicts
- #2102 at 3b48e12 now includes
release,retain_onlyandadoptedfor Loop (Loop.md:67,145) and PromptAdoption.md:85-96 definesconfigureandinvalid_model; the earlier P2 is fixed. ToolBinding.md:18 omitsadoptedfrom Loop's call list while #2102 lists it; the operation exists, so this is a minor wording mismatch. - #2103 at 59a77a3 keeps the async
declarationsand the message-only adopt errors; P2 1 remains. - #2101 at 18d5e4f rewrites Hooks.md and edits README.md and service-faces.md, which this PR also edits. Expect a textual conflict; #2101 already cites
Permission.adviseandApproval.decide. - #2093 at 53961a1 also edits runtime-owner-operations.md and session-boundary.md, and its runtime-owner-operations.md still has the old
toolBindingrow. Its SessionScopehold/releaseand FileAccessFactscheckshapes match this PR's requirements. - #2094 at 0677c71 defines
permissionRules.rulesas this PR requires. Its changed docs/design/appserver/permission-command-rules.md:27,266,305 still says Approval's methods,approval.respondand replay are unchanged; the client method keeps its name, but the Rustrespondandreplaydo not. - #2098 at c3acab3 and #2099 at 8f440bd reference
approval.respondas a client method; this PR keeps that name, so those references stay valid, but both PRs also edit README.md or service-faces.md and will conflict textually. - #2029 is merged on current main at 4d081fe. ADR 027 is present and proposed; the PR's links to the pull request should become links to the ADR.
Verification
- Head 437266b verified in the detached worktree. origin/main is bf3a4e6;
git merge-tree --write-tree origin/main HEADis clean. - LC_ALL=en_US.UTF-8 with isolated HOME and TMPDIR under the data directory.
node scripts/adr-check.mjs --base 5a279d69passed; a local Markdown link check over the 12 changed files found 0 broken links. No Rust tests were run because the change is docs-only. No processes were started, so none remain. - CI:
changesandci-oksucceed; the other jobs are skipped for a docs-only change. mergeStateStatus is BLOCKED by review, not by CI.
| }).await?, // AlreadyBound, Invalid, Unavailable, Closed | ||
| None => { | ||
| // No tool part: declare the registry's current host and contributed tools. | ||
| let current = registry.declarations()?; |
There was a problem hiding this comment.
registry.declarations() is called synchronously here and at line 82. PR #2103 at 59a77a3 declares pub async fn declarations and awaits it (ToolRegistry.md:82,340). The sample does not compile against the sibling contract. Fix: use registry.declarations().await? in both places, or change #2103 to sync and state the async boundary.
| | `invalid` | `bind` | No | The registry refused the declarations; the error names the declaration and the reason; fail the turn and report them. | | ||
| | `unavailable` | `bind` | Yes, after re-preparing | The prefix declares a source version the registry no longer retains; re-prepare from the current declarations, or fail the turn. | | ||
| | `no_record` | `adopted`, `claim`, `transfer` | No | The request has no record: a caller bug or a request released before its batch; fail the turn as a fault. A reload settlement is not this error. | | ||
| | `callback` | `claim` | Depends on the cause | The contributor's claim callback refused; the error carries the call id, and the callback's own code in `reason` and its message in `message`. The batch is not published; the turn fails unless the cause says the call may be retried in a later request. | |
There was a problem hiding this comment.
This callback row and the appendix at line 287 require call_id, but #2103's ToolError::Callback carries only cause.code and cause.message (ToolRegistry.md:218,245), and claim answers only the claimed ids on success (ToolRegistry.md:108). A refused batch therefore cannot name the call. #2103's invalid claim error (ToolRegistry.md:122) also has no mapping here. Fix: add the call id and map invalid in #2103, or drop call_id and define the mapping here.
| | `callback` | `claim` | Depends on the cause | The contributor's claim callback refused; the error carries the call id, and the callback's own code in `reason` and its message in `message`. The batch is not published; the turn fails unless the cause says the call may be retried in a later request. | | ||
| | `closed` | any | No, in this generation | The branch is closing or reloading; the turn ends; a replacement generation serves the next request. | | ||
|
|
||
| `bind` errors carry the declaration that failed (`name`) or the source that is gone (`key`, `version`); the owner reports no failure the record cannot have. |
There was a problem hiding this comment.
bind errors are documented with the failed declaration's name and the source's key/version, but #2103's adopt refuses with Invalid { message } and Unavailable { message } (ToolRegistry.md:212-219). ToolBinding cannot fill these fields from a batch refusal without parsing the message. Fix: add the structured fields to #2103's adopt errors, or narrow BindingError to what the registry returns and state the change.
| | --- | --- | --- | --- | | ||
| | `PreToolUse` | `Approval::admit(AdmitCall {source, call}, risk, cancel)` calls `Permission::decide(call, risk, cancel)` for the admission and again for the recheck after an allow; `decide` already awaits the command-rules port; a Deny becomes `HostError::failed(reason)`, the error text of the call's result | `decide` cannot ask anyone else, does not receive `source` (the call id is only in `AdmitCall.source`), and cannot tell the admission from the recheck | A.6.1: Approval passes `source` to the admission decision only; Permission calls its registered advisors there. ToolExecutor needs no change | | ||
| | `PermissionRequest` | `approval/request {approval_id, source, call, reason}`; `Approval::respond(approval_id, decision)` accepts the first consumed response, else `Unknown`/`Cancelled`/`Closed`; `approval/respond {approval_id, decision}` has no reason | No reason on a deny | Usable as is; a hook deny shows Approval's generic text (decision 7) | | ||
| | `PermissionRequest` | `approval/request {approval_id, source, call, reason}`; `Approval::respond(approval_id, decision)` accepts the first consumed response, else `Unknown`/`Cancelled`/`Closed`; `approval/respond {approval_id, decision}` has no reason | The target renames the operation to `approval.decide(approvalId, decision)` ([Approval](../plugins/Approval.md)); the fact and the client method keep their names | `decision` accepts the first consumed answer, else `unknown`; a hook deny shows Approval's generic text (decision 7) | |
There was a problem hiding this comment.
Approval.md:113 says respond is removed as the Rust-only skip method and decide is already the face's operation; it is not renamed. The codes are Unknown, Failed and Closed (Approval.md:194-195), not unknown, and the advisor duplicate is Duplicate (Permission.md:100), not duplicate at line 504. A delivery task following this row can rename respond into a collision with the existing decide (crates/dim-agent-capabilities/src/approval.rs:91) and match the wrong wire codes. Fix: say respond is removed and decide is unchanged, and use the owner contracts' spellings. Since #2101 at 18d5e4f rewrites Hooks.md, dropping these Hooks edits from this PR is the simpler fix.
| ```rust | ||
| let reply = reads.binding(BindingRequest { path: canonical, purpose: Purpose::Edit }).await?; | ||
| let binding = match reply { | ||
| BindingReply::Bound(binding) => binding, |
There was a problem hiding this comment.
Bound is a struct variant, Bound { binding: TextFileBinding } (FileReads.md:230-231), so this tuple pattern does not compile. The first example at line 45 uses the struct form. Fix: BindingReply::Bound { binding } => binding.
| | Context RPC → target branch | `agentLoop.compact` and `contextUsage.read`. | | ||
| | Goal and Shell admission → timelineTree | `directory({id})` returns the matching directory entry or the unknown-branch error using a single-branch lookup. Goal reads ended history through `query`; writes retain the ended/unknown errors. | | ||
| | InputQueue and Collaboration approvals → target branch | `timelineTree.input`, `inputQueue.withdraw` after submission checks, and `approval.pending/decide` on the selected branch. | | ||
| | InputQueue and Collaboration approvals → target branch | `timelineTree.input`, `inputQueue.withdraw` after submission checks, and `approval.pending/decide` on the selected branch([Approval](../plugins/Approval.md)); the caller reaches the line's owner by line id ([ADR 027](https://github.com/arcships/dim/pull/2029)). | |
There was a problem hiding this comment.
The new links at lines 26, 48, 63, 76 and 77 use full-width Chinese parentheses in an English document. Fix: replace them with ASCII parentheses.
| # Plugin designs | ||
|
|
||
| Designs of the new plugins and proposed supplements to existing plugins in the [overall design](../overview.md). Local-execution plugins and their capabilities are documented in [architecture/rust-agent/plugins](../../architecture/rust-agent/plugins/README.md). Rules: [design rules](../../architecture/rust-agent/principles.md) §1 and §4, [ADR 002](../../adr/002-plugin-scope.md), [plugin contract](../plugin-contract.md) ([ADR 006](../../adr/006-plugin-contract.md)). Shared contracts: [session-access](../contracts/session-access.md), [session-boundary](../contracts/session-boundary.md). | ||
| Designs of the new plugins and proposed supplements to existing plugins in the [overall design](../overview.md). Local-execution plugins and their capabilities are documented in [architecture/rust-agent/plugins](../../architecture/rust-agent/plugins/README.md). Rules: [design rules](../../architecture/rust-agent/principles.md) §1 and §4, [§7 owners and operations](https://github.com/arcships/dim/pull/2029) (target, pending #2029), [ADR 002](../../adr/002-plugin-scope.md), [plugin contract](../plugin-contract.md) ([ADR 006](../../adr/006-plugin-contract.md)). Shared contracts: [session-access](../contracts/session-access.md), [session-boundary](../contracts/session-boundary.md). |
There was a problem hiding this comment.
#2029 merged at 4d081fe and is on current main, so section 7 is no longer pending. The same PR link appears at Approval.md:168, BackgroundExec.md:17, FileReads.md:18,76,156, runtime-owner-operations.md:26 and background-task-output.md:74. Fix: link docs/adr/027-cross-scope-access-by-id.md and the principles section 7 anchor, and drop the pending label.
| | `Cancelled` | `admit` | No | The batch token was dropped or the batch was interrupted; do not run the call. | | ||
| | `Failed` | `admit`, `decide` | Yes, by a later attempt | The request or response could not be committed (storage or fact failure); nothing is pending for the call, or the answer did not take; the owner reports a fault and the turn fails. A repeated call is a new admission or a fresh answer. | | ||
| | `Closed` | any | No, in this generation | The generation is closing or reloading; stop; a replacement generation serves the next request. | | ||
| | `Unknown` | `decide` | No | The request is no longer pending; retire the prompt and do not retry the answer. A repeated answer is `unknown` too. | |
There was a problem hiding this comment.
The error kinds and the appendix use PascalCase (Unknown, Closed and the rest at Approval.md:194-195), but this row's prose says unknown and line 103's says closed. A cross-language caller matching the backticked strings can miss the wire codes. Fix: use Unknown and Closed in both sentences.
| | §7 resources and objects | No resource; no object crosses. Advice is a callback by reference. | | ||
| | §7 no proxy | The owner answers its own decision and publishes its own state. | | ||
| | §7 one surface | `decide`, `update`, `advise`, and the published value; `admit_decision`, `check` and the separate `decide` are removed. | | ||
| | §7 cross-language | Every parameter and reply is data; the decision is a value, not an error. | |
There was a problem hiding this comment.
This row says every parameter and reply is data, but advise takes a callback by reference (line 124), and the request column at line 85 lists caller: &Ctx while line 181 says the caller is not a request field. Fix: say data or a callback by reference (service-faces section 1 rule 4), and show the request as {name, callback} with the caller noted separately.
|
Closing as part of abandoning the owner-split experiment. |
Refs #2028 · Refs #2015
Summary
Target contracts for the six owners of the branch tool chain: ToolBinding, ToolExecutor, Approval, Permission, BackgroundExec and FileReads. Each document states the owner's responsibility split, the caller intents behind its operations, the operations with cancellation and errors, the flows, exceptions with reasons, the rule check and the requirements raised to sibling owners.
The surfaces become data faces:
toolBinding,toolExecutor,approval,permission,backgroundExec,fileReads. No handler, claim guard, gate object or live process crosses an owner: execution moves to ToolRegistry's operations, declarations stay with the pin record, calls are adopted from the host's task id, and approval answers are one data operation.Delivery
The delivery part — deletion list, caller migration, implementation task and acceptance — is on #2028.
Verification
node scripts/adr-check.mjs --base origin/mainpassed.cargo run --locked -p xtask-checkpassed.Merge order
#2029 → #2080 → #2091/#2092/#2093 → #2094 → #2096 → the rest.
Sibling heads this change is aligned with: #2092
d96802349, #21023b48e1248, #210359a77a3d1. A paragraph that depends on a sibling names that PR; its head is the one above.