Agent execution verification and dependency subgraph recovery method and system for heterogeneous tool validation state uncertainty
By generating action records and effect item records, the dynamic dependency graph manager generates an action dependency graph, the evidence verifier verifies the tool call results, and generates isolation records and recovery plans, the problem of uncertainty in the effective state when an agent calls heterogeneous tools is solved, and accurate resource recovery and state verification are achieved.
Patent Information
- Application Number
- CN202611665468.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-27
- Publication Date
- 2026-11-24
AI Technical Summary
When an agent invokes heterogeneous tools, existing technologies cannot accurately determine the effective status, which may lead to duplicate object creation, resource consumption, misjudgment of operation success or failure, and inaccurate dependency graph recovery, which may miss dynamic dependencies or overwrite legitimate modifications.
By generating action records and effect item records, the dynamic dependency graph manager generates an action dependency graph, the evidence verifier verifies the results of the tool call, generates isolation records and recovery plans, propagates the effect judgment records in the action dependency graph, forms a recovery set and a set to be retained, executes recovery processing items, and generates a continuation execution status package.
Accurately determine the effective status to prevent duplicate calls and resource consumption, reduce unnecessary compensation actions, lower the risk of misselected objects and concurrent coverage, and ensure accurate recovery scope.
Smart Images

Figure CN123157518A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software runtime control and distributed state recovery technology, and in particular to a method and system for agent execution verification and dependency subgraph recovery for heterogeneous tools with uncertain effective state. Background Technology
[0002] With the development of large language model technology, agents are increasingly being used to perform tasks that require invoking external tools. The agent generates tool action proposals based on the task objective, and the runtime system then invokes various heterogeneous tools to complete the specific operations. These heterogeneous tools vary significantly in capability: some support idempotent calls and allow querying the final state by operation identifier, some only provide resource snapshot queries, some provide feedback results asynchronously, and others do not support idempotency or provide a reliable final state query interface. This raises a problem: when an agent calls a heterogeneous tool and receives no response, an incomplete response, or a response that does not match expectations, the system cannot determine whether the external effect of the call has taken effect.
[0003] In existing technologies, one type of solution is based on transaction snapshots and sequential compensation: by saving transaction snapshots and scanning execution status, reverse operation compensation or custom compensation is selected when failure is detected, which is suitable for data recovery of integrated systems; or a compensation transaction is created at the start of the service, and the compensation transaction is sent in reverse order of execution when execution fails, which is suitable for transaction recovery of multiple services. This type of solution is based on a binary result of "success or failure of the call" and triggers compensation according to the failure signal; however, transport layer timeout, connection disconnection, or missing receipt does not necessarily mean that the remote operation has not taken effect. For tools that do not support idempotency, automatic retry based on failure signals may repeatedly create objects or repeatedly occupy resources.
[0004] Another approach is to determine the compensation set based on dependency relationships: associating state snapshots and events, using the business activity dependency graph to determine the subset that must be rolled back after a failure, and assessing whether other operations can exist independently to generate a compensation plan. This type of approach involves dependency analysis and selective compensation, but its dependency graph is usually a pre-set static graph, which is difficult to cover data dependencies, shared resource conflicts, and cross-branch constraints that are dynamically generated during the operation of the agent, and may still result in missed or incorrect recovery.
[0005] In the area of agent recovery, existing works directly use tool interceptors and persistent transaction logs to attempt retries, alternative tools, and compensation after failure, and write the recovery status back to the agent context. Other works associate normalized actions and acknowledgment events with persistent authorization states, using prepare, commit states, and stable idempotent keys to limit duplicate processing. These works demonstrate that "logging, retrying, compensation, and context updating" are known approaches, but their anti-duplicate mechanisms rely on downstream idempotency capabilities and do not differentiate between evidence determination under conditions of varying tool observation capabilities. Furthermore, they do not address the issue of the agent context still referencing old return values and old summaries after recovery, leading to the re-execution of actions based on invalid evidence.
[0006] In summary, the existing technology has at least the following drawbacks: (1) Transport layer timeout, connection disconnection, or missing receipt does not necessarily mean that the remote operation has not taken effect. For tools that do not support idempotency, automatic retry may repeatedly create objects or occupy resources; for operations that have taken effect but have lost receipt, misjudging them as not taking effect may also lead to long-term resource occupation. (2) Different tools provide operation records, resource snapshots, asynchronous events, or versionless queries, and their observation capabilities vary. If the source, completeness, and visibility conditions of evidence are not distinguished, a similar current state may be misjudged as a successful operation, and a lack of results may be misjudged as an operation not being executed. (3) Compensating the entire amount in the preset order may revoke the valid results that should have been retained independently; relying solely on the static dependency graph may miss the data dependencies, shared resource conflicts and cross-branch constraints that are newly generated during the operation of the agent, and the recovery range is difficult to determine accurately. (4) After external compensation is completed, the agent context may still reference the old return value and the old summary, causing the action based on the invalid evidence to be executed again. If there is external concurrent rewriting during the compensation process, directly restoring the old snapshot may also overwrite subsequent legitimate modifications.
[0007] The disclosure of the above background technical content is only for the purpose of assisting in understanding the concept and technical solution of this application, and does not necessarily provide technical instruction. Summary of the Invention
[0008] The purpose of this invention is to provide a method for agent execution verification and dependency subgraph recovery in the face of uncertainty in the effective state of heterogeneous tools. Under the conditions of uncertainty in the effective state of tool calls and heterogeneity in tool observation capabilities, the effective state is accurately determined based on verifiable external evidence, and the recovery scope is constrained within the affected dependency subgraph.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows: This invention provides a method for agent execution verification and dependency subgraph recovery to address the uncertainty of the effective state of heterogeneous tools. The method is deployed between the agent and the heterogeneous tools and includes the following steps: S101. The intelligent agent generates a tool action proposal based on the received target task and generates a task target record containing the task identifier and target version; the execution gateway reads the tool effect contract of the heterogeneous tool and the tool action proposal, and generates an action record and an effect item record; the dynamic dependency graph manager generates an action dependency graph based on the actual parameter references, resource access scope, and constraint groups of the action; the execution gateway persists the action record, effect item record, and action dependency graph, and after registration and verification, sends a tool call request corresponding to the action record to the heterogeneous tool; S102. If no final state receipt is received for the tool call request, the effect item corresponding to the tool call request is set to "unknown effectiveness". Using the action to which the effect item with "unknown effectiveness" belongs as an uncertainty seed, propagate along the dependency edges and constraint groups in the action dependency graph to determine the set of actions and resource scope that need to be isolated, and then generate an isolation record. The isolation record is used by the execution gateway to prevent duplicate tool call requests for the same resource and the issuance of subsequent actions that depend on the execution result of the tool call request. It also generates a verification item containing the original operation identifier and contract version. S103. The evidence verifier verifies the actual response execution result of the tool call request based on the original operation identifier and contract version in the item to be verified, rather than re-initiating the tool call request, and obtains the verification evidence record. S104. Based on the verification data record, determine each effect item as having occurred, not having occurred, or unknown, and generate an effect determination record, which includes the overall status of being effective, not effective, partially effective, and unknown in effect, as well as the action type of business action and compensation action; provide the effect determination record of action type business action to step S105, and provide the effect determination record of action type compensation action to step S106. S105. Based on the overall status in the effect judgment record of the action type being business action and the task target record, determine the effect items that need to be canceled, retried under control, or supplemented, and their corresponding action instances, and propagate them in the action dependency graph to form a recovery set and a set to be retained; perform boundary verification on the recovery set and the set to be retained, generate a recovery plan containing processing type, version reference, and boundary verification results, and register the control revision number corresponding to the recovery plan; S106. Based on the effect determination record of the action type being a compensation action, execute the processing items corresponding to the recovery set according to the recovery plan, including: for processing items that need to be re-executed, register new attempts associated with the original processing items; for effective effect items that need to be revoked, perform conditional compensation and verify the compensation effect; if the compensation effect is unknown, re-execute steps S102 to S104; summarize the verification results of each processing item and the processing items that have not been verified to generate a recovery result record; S107. Based on the recovery result record and the set to be retained, generate a continued execution status package to be published; in the same local commit, verify the version reference and control revision number of the recovery plan, and publish the continued execution status package as the current control state used by the execution gateway after all matches are found. If the publication fails, maintain the original isolation; the execution gateway verifies the reference and issuance conditions of subsequent actions based on the published current control state to realize the closed loop of execution verification, dependency subgraph recovery and continued execution control.
[0010] Furthermore, following any one or a combination of the aforementioned technical solutions, step S105, in which the propagation of the recovery set and the intended retention set in the action dependency graph includes: For effect items whose overall status is "already in effect" and whose task objective records require the retention of the corresponding effects, their corresponding action instances are included in the set to be retained. For effect items whose overall status is "effective" and whose corresponding effects have been canceled in the task objective record, generate a processing item with the processing type "conditional compensation". For write actions whose overall status is ineffective and whose task objective requires the corresponding effect, generate a processing item with the processing type of controlled retry; For effect items whose overall status is inactive and whose corresponding effects have been canceled in the task objective record, discard action proposals that have not yet been issued; For actions that are partially effective in the overall state, only the effects that have not yet occurred are processed with a single-item completion type, and the effects that have occurred and their verification evidence records are retained; For actions whose overall status is unknown, continue to remain isolated and do not enter the recovery set; The action instance corresponding to the generated processing item is used as a seed and propagated along the action dependency graph to form the recovery set.
[0011] Furthermore, following any or a combination of the aforementioned technical solutions, step S104 further includes generating a read determination record for a pure read action without external write effect, which includes distinguishing between valid results, invalid results, and read states pending verification. Step S105 further generates failure handling or re-reading processing items for read judgment records with invalid read status, determines the action instance to which the read judgment record belongs, and propagates along the action dependency graph with the action instance as a seed to be included in the recovery set; for read judgment records with valid read status, the action instance to which it belongs participates in the retention verification of the proposed retention set. If the verification passes, it is included in the proposed retention set; if the verification fails, it continues to be isolated; for read judgment records with pending verification status, verification data records continue to be obtained. If the verification data records are still insufficient, the action instance to which the read judgment record belongs continues to be isolated.
[0012] Furthermore, following any one or a combination of the aforementioned technical solutions, step S105, which involves boundary verification of the recovery set and the set to be retained, includes: comparing the resource change range of each processing item in the recovery set with the input evidence, control premises, resource version, and constraint group of the action in the set to be retained, and performing boundary verification item by item. If the resource change range does not intersect with the dependency range of the action in the set to be retained and the constraint group allows it to exist independently, then the boundary verification passes. Completed consumption actions that fail boundary verification are added to the recovery set, while completed consumption actions that cannot be determined by boundary verification remain isolated.
[0013] Furthermore, in addition to performing boundary verification item by item based on any one or a combination of the aforementioned technical solutions, the process also includes: If the resource change range of the processing item in the recovery set intersects with the dependency range of the action in the intended retention set, then the dependency predicate of the action in the intended retention set is still valid after the processing item is executed, based on the tool effect contract. If there is current evidence to support the judgment, the boundary verification passes; if there is no current evidence to support the judgment, the boundary verification fails.
[0014] Furthermore, following any one or a combination of the aforementioned technical solutions, in step S104, the determination method for the effect item is as follows: If there is evidence of completion covering all promised changes for that effect, then that effect is considered to have occurred. If there is both evidence that the event did not occur and grounds for termination of the request to prevent the subsequent effect from taking effect, then the effect item is determined to have not occurred. If there is evidence that no action has occurred but no grounds to prevent the attempt to take effect from terminating the request, then the effect item is determined to be unknown; If there is conflicting or missing evidence, the effect item is determined to be unknown.
[0015] Furthermore, following any one or a combination of the aforementioned technical solutions, in step S104, the overall state is determined in the following manner: The overall state is determined according to the following rules, using the set of necessary effect items determined based on the tool effect contract at the time of action registration as the summary scope: If all the effects in the set of required effects are determined to have occurred, then the overall status is "effective". If all effect items in the set of required effect items are determined to have not occurred, the overall status is ineffective. If at least one effect in the set of required effect items is determined to have occurred, at least one effect item is determined to have not occurred, and no effect item is determined to be unknown, then the overall state is partially effective. If any effect item in the set of required effect items is determined to be unknown, the overall state is "unknown". For the overall state where the effect is unknown, retain the individual judgment details of all effect items, where effect items that have been judged to have occurred will not be downgraded to unknown due to the lack of request termination basis.
[0016] Furthermore, following any one or a combination of the aforementioned technical solutions, the action type of the effect determination record in step S104 is inherited from the action type determined when the corresponding action record is registered: the action record registered by the execution gateway according to the tool action proposal has an action type of business action; the new action record registered by the execution gateway for the processing item in the recovery plan as associated with the original action and its effect item has an action type of compensation action. Step S104 provides the effect judgment record of the action type as a business action to step S105, and step S105 determines the processing type based on the overall status and the task target record; the effect judgment record of the action type as a compensation action is provided to step S106, and step S106 refers to the original recovery plan and processing item identifier to confirm or continue to verify the original processing item, and does not treat the compensation action as a processing item for generating reverse compensation for business failure.
[0017] Furthermore, following any one or a combination of the aforementioned technical solutions, the control revision number is the version identifier of the current control state in the local persistent ledger of the execution gateway, which increments as the isolation scope increases or the continued execution state package is successfully published; Step S105: Before the recovery is issued, the scope of impact of the processing item is incorporated into the isolation record and persisted. If there are new isolation scopes, the control revision number is incremented. If the existing isolation covers the entire scope, the current control revision number is reused. The recovery plan saves the control revision number after isolation registration. If new verification data, action dependency graphs or task target records change after registration, the recovery plan is re-verified. The continuation status packet in step S107 carries the control revision number read at creation time. If the control revision number read at creation time is consistent with the current control revision number in the same local commit, the commit is made and the control revision number is incremented. If they are inconsistent, the commit is rejected, the original isolation is maintained, and the continuation status packet is recalculated.
[0018] Furthermore, following any one or a combination of the aforementioned technical solutions, generating the pending execution status package in step S107 includes: The evidence invalidation and context revision module reads the recovery result record, locates the corresponding original core verification evidence from the revoked effect item and the read judgment record with the read status being invalid, generates a pending invalidation mark, generates an invalid evidence list from the pending invalidation mark, and determines the invalidation scope of the derived content layer by layer along the evidence citation relationship until there are no more new derived objects. A valid reference index is generated from the verified valid outputs in the set to be retained. The index entries of the valid reference index are associated with evidence identifiers, actions, and available fields. References to be invalidated are not included in the valid reference index. The prohibited action set is obtained by summarizing and deduplicating the restricted actions in the isolation record, the unverified completed processing items in the recovery result record, and the subsequent actions that still cite invalid evidence; The pending execution status package is generated from the valid reference index, the list of invalid evidence, the remaining isolation range, the set of prohibited actions, the current target version of the task target record, the current plan version of the recovery plan, and the control revision number read at creation. During the generation process, the current control state of the execution gateway and its control revision number remain unchanged.
[0019] Furthermore, following any one or a combination of the aforementioned technical solutions, after the successful publication of the continued execution status package in step S107, the method further includes: The execution gateway verifies subsequent actions based on the published current control state: it rejects the issuance of tool action proposals that reference credentials or parameters in the invalid evidence list; and it allows the issuance of subsequent actions that use valid outputs in the valid reference index, provided that the current task target record still requires the corresponding effect and the premise for using the valid output has not been revoked. After publishing the continued execution status package, check the termination conditions again: if the target effect is met, the dependencies are valid, and there are no pending isolation items affecting the target, mark it as successfully completed; if the recovery process is completed, there are no related unknown effects, and the safe state allowed by the tool effect contract is reached, mark the recovery as completed; if there are still unknown effects, version conflicts, known effects that cannot be safely processed, or the release is not completed, mark it as pending verification and retain the corresponding isolation.
[0020] Furthermore, following any one or a combination of the aforementioned technical solutions, the intelligent agent re-plans and generates new tool action proposals based on the published current control state. The new tool action proposals proceed to step S101. For new tool action proposals that have not yet been registered with action identifiers, the execution gateway verifies the remaining isolation range and the evidence references used. If the references are invalid evidence or fall within the remaining isolation range, the proposal is rejected. If the target effect has been fully satisfied and there are no pending isolation items, no new tool action proposals are generated.
[0021] According to another aspect of the present invention, an agent-based verification and dependency subgraph recovery system is provided for addressing uncertainties in the effective state of heterogeneous tools. This system is deployed between the agent and the heterogeneous tools and includes the following modules: An intelligent agent is configured to generate tool action proposals based on the received target task and to generate a task target record containing a task identifier and a target version. An execution gateway and persistent ledger are configured to read the tool effect contracts and tool action proposals of heterogeneous tools, and generate action records and effect item records. The execution gateway persists the action records, effect item records, and action dependency graph. After registration and verification, it sends a tool invocation request corresponding to the action record to the heterogeneous tool. If no final state acknowledgment is received for the tool invocation request, the effect item corresponding to the tool invocation request is set to "unknown effectiveness". Using the action to which the effect item with "unknown effectiveness" belongs as an uncertainty seed, the uncertainty is propagated along the dependency edges and constraint groups in the action dependency graph to determine the set of actions and resource scope that need to be isolated, thereby generating an isolation record. The isolation record is used by the execution gateway to prevent duplicate tool invocation requests for the same resource and the issuance of subsequent actions that depend on the execution result of the tool invocation request. It also generates a pending verification item containing the original operation identifier and contract version. The dynamic dependency graph manager is configured to generate an action dependency graph based on the actual parameter references of the actions, resource access scopes, and constraint groups. An evidence verifier is configured to verify the actual response execution result of the tool invocation request based on the original operation identifier and contract version in the item to be verified, rather than re-initiating the tool invocation request, and obtain a verification evidence record; based on the verification evidence record, determine each effect item as having occurred, definitely not having occurred, or unknown, and generate an effect determination record, which includes an overall status distinguishing between effective, ineffective, partially effective, and unknown effectiveness, as well as an action type distinguishing between business actions and compensation actions; and provide the effect determination record to the isolation and recovery controller. An isolation and recovery controller is configured to determine, based on the overall state in the effect judgment record for action types (business actions) and the task target record, the effect items to be revoked, retried under control, or supplemented, and their corresponding action instances, and propagate them in the action dependency graph to form a recovery set and a set to be retained; perform boundary verification on the recovery set and the set to be retained, generate a recovery plan containing processing type, version reference, and boundary verification results, and register the control revision number corresponding to the recovery plan; and execute the processing items corresponding to the recovery set according to the recovery plan based on the effect judgment record for action types (compensation actions), including: registering new attempts associated with the original processing items for processing items that need to be re-executed; performing conditional compensation and verifying the compensation effect for effective effect items that need to be revoked; if the compensation effect is unknown, re-execute steps S102 to S104; and summarizing the verification results of each processing item and the processing items that have not been verified to generate a recovery result record. The evidence invalidation and context revision module is configured to generate a continued execution status package to be published based on the recovery result record and the set to be retained; in the same local commit, it reviews the version reference and control revision number of the recovery plan, and publishes the continued execution status package as the current control state used by the execution gateway after all matches are found, and maintains the original isolation if the publication fails; the execution gateway verifies the reference and issuance conditions of subsequent actions based on the published current control state.
[0022] Furthermore, following any one or a combination of the aforementioned technical solutions, the control revision number is the version identifier of the current control state in the local persistent ledger of the execution gateway and the persistent ledger, and it increments as the isolation scope increases or the continued execution state package is successfully published; Before issuing a recovery, the isolation and recovery controller incorporates the impact scope of the processed item into the isolation record and persists it through the persistent ledger. If there are new isolation scopes, the control revision number is incremented. If the existing isolation covers the entire scope, the current control revision number is reused. The recovery plan saves the control revision number after isolation registration. If new verification data, action dependency graphs, or changes in task target records occur after registration, the recovery plan is re-verified. The continued execution status packet generated by the evidence invalidation and context revision module carries the control revision number read at creation time; in the same local commit, if the control revision number read at creation time is consistent with the current control revision number, the commit is published and the control revision number is incremented; if they are inconsistent, the commit is rejected, the original isolation is maintained, and the continued execution status packet is recalculated.
[0023] The beneficial effects of the technical solution provided by this invention are as follows: a. Treating actions with unknown effects as uncertainty seeds, propagating them along dependency edges and constraint groups in the action dependency graph to determine the isolation scope, and using this scope, the execution gateway prevents duplicate tool call requests for the same resource and subsequent actions dependent on the execution result of that request from being issued. Independent branches that do not intersect with the isolation scope and have no common pause constraints can continue to execute. Thus, before the actual result is determined, it can prevent duplicate requests and downstream operations based on unconfirmed resources without suspending the entire task. b. Based on the effect judgment record and task target record, the recovery set and the set to be retained are formed by propagation in the action dependency graph, and the recovery range is constrained by boundary verification. Thus, the recovery decision is constrained by the effect evidence and the target, and only the effect items that need to be undone, retried in a controlled manner or supplemented are processed. This avoids the full compensation in the preset order and the cancellation of valid results that should be retained independently. It also avoids relying solely on the static dependency graph and omitting dynamically generated dependencies, thereby reducing unnecessary compensation actions and the external state disturbances they cause. c. For effects that need to be revoked, conditional compensation is performed, and the true resource identifier and resource version are extracted from the associated verification evidence record as the basis for compensation objects. The compensation parameters do not depend on the object identifier regenerated by the model. Conditional compensation is constrained by the atomic version check of heterogeneous tools. When there is a version conflict, the branch is stopped and re-verified. When concurrency protection cannot be obtained, isolation is maintained. This reduces the risk of misselecting compensation objects and covering legitimate external concurrent modifications, avoids making invalid recovery guarantees, and reduces the risk of misselecting compensation objects and concurrent coverage. d. Summarize the verification results of each processing item and the processing items that have not been verified to generate a recovery result record. Based on this, locate the original verification evidence corresponding to the revoked effect and generate a continuation execution status package. During the release, review the version reference and control revision number of the recovery plan in the same local commit. Only after all match is it released as the current control state used by the execution gateway. If the release fails, maintain the original isolation. Thus, the recovery of external effects, the invalidation of derived evidence, and the release of gateway control state are interconnected: the original reserved credentials and their derived parameters and digests become invalid along with the release. Even if the agent still holds the old "success" memory and makes the same request again, the execution gateway rejects the invalid reference based on the released current control state, eliminating the re-execution based on invalid evidence from the execution side, blocking the reuse of old results from the execution gateway, and reducing the state separation of "externally revoked, internally still considered successful". Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 A flowchart illustrating an exemplary embodiment of the present invention for a method of performing verification and dependency subgraph recovery by an agent facing uncertainty in the effective state of heterogeneous tools; Figure 2 This is a schematic block diagram of an agent-based verification and dependency subgraph recovery system for addressing uncertainties in the effective state of heterogeneous tools, provided as an exemplary embodiment of the present invention. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0027] It should be noted that terms such as "first" and "second" in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such uses of the objects can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0028] An agent has sent a resource reservation request to a heterogeneous tool (such as a resource system) but has not received a confirmation response. At this point, it's impossible to determine whether the reservation was successful or what resources were actually allocated. Retrying the request directly might lead to duplicate server resource usage, while submitting a training task directly might use unreserved resources, causing task execution errors. This invention aims to solve the problem of agent subsequent decision-making and resource status verification in scenarios with uncertain operational outcomes: when an agent initiates a server resource reservation request to a heterogeneous tool, and due to network interruptions or other abnormal situations, it's impossible to confirm whether the request has actually taken effect, how to avoid the dilemma of repeatedly requesting resources and wasting resources, or directly submitting a training task using unconfirmed resources and causing task failure.
[0029] In one embodiment of the present invention, a method for agent execution verification and dependency subgraph recovery is provided to address the uncertainty of the effective state of heterogeneous tools. This method is deployed between the agent and the heterogeneous tools. The agent generates tool action proposals based on the task objective. At runtime, the execution gateway reads the proposals, tool effect contracts, and existing valid evidence to complete action registration, issuance, and execution verification. All tool calls and recovery calls that modify controlled external resources pass through the gateway. The tool can be an application interface, database proxy, controlled command wrapper, or device service interface. In general, for actions with external write effects, this invention generates and uses the following results: Action records and effect item records are generated from the tool effect contract and action proposal; an action dependency graph is generated from actual parameter references and resource access scope; the external state is queried from the original operation identifier in the action record, and a verification evidence record is generated; an effect judgment record is generated from the verification evidence record; the effect judgment record is located to nodes and edges in the action dependency graph, generating an isolation record and a recovery plan; after the recovery impact scope is persisted as isolation, retention, invalidation, controlled retry, completion, or conditional compensation are performed according to the type of each processing item in the recovery plan, generating a recovery result record; the recovery result record is used to determine the invalidation scope of old evidence and derived content, generating a continuation execution status package to be released, which is then released as the current control state for gateway use after version and integrity verification, for use in the next round of action registration and distribution verification.
[0030] like Figure 1 As shown, the method includes the following steps: S101. The intelligent agent generates a tool action proposal based on the received target task and generates a task target record containing the task identifier and target version; the execution gateway reads the tool effect contract of the heterogeneous tool and the tool action proposal, and generates an action record and an effect item record, wherein the tool effect contract records the compensation rules and the conditional operation capabilities declared by the heterogeneous tool; the dynamic dependency graph manager generates an action dependency graph containing action nodes, dependency edges, and constraint groups based on the actual parameter references, resource access scope, and constraint groups of the action; the execution gateway persists the action record, the effect item record, and the action dependency graph, and after registration and verification, sends a tool call request corresponding to the action record to the heterogeneous tool for the verified action; The task objective record is formed by the objective, constraints, and allowed termination conditions received from the task interface, and has a task identifier and objective version.
[0031] Target Task Implementation Example: The following uses the same server resource request task throughout steps S101 to S102-S107. The task interface receives task T1, and the first version of the target task is: "Reserve 3 GPU servers in computing cluster CL-G01 that meet the configuration requirements listed in the task for training job JOB-01, submit training to the scheduler after obtaining valid reservation credentials; simultaneously, read-only query the device status of independent backup storage cluster BK-01 and generate a local inspection summary." The server configuration requirements come from the task input, and the resource system is responsible for matching devices. This method controls the resource request, verification, and recovery process, and does not perform device power control. Reservation indicates that the resource system registers the occupancy relationship for JOB-01, and does not indicate that training has started. The identifiers, versions, and timings in this example are design examples and do not represent actual product capabilities or test results.
[0032] The first version of the objective of task T1 above, "to reserve 3 GPU servers in computing cluster CL-G01 that meet the configuration requirements listed in the task for training job JOB-01, submit training to the scheduler after obtaining valid reservation credentials; and simultaneously query the device status of independent backup storage cluster BK-01 in read-only mode to generate a local inspection summary," contains three actions: reservation action (denoted as A1), training submission action that has not yet been issued (denoted as A2), and independent inspection reading action (denoted as A3). Further, the first attempt of A1 is denoted as A1-1, and the remote operation identifier is denoted as OP-01; the three effect items of A1, A1-E1, A1-E2, and A1-E3, initially represent the three allocation slots for slot 1, slot 2, and slot 3, respectively, with the actual device identifiers to be bound after verification via receipt or query. The parameters of A2 reference the reservation credentials and device list returned by A1; A3 does not reference A1 or A2, is not written to external resources, and its inspection objective has no common success or failure constraint with the training job. The initial action set V is {A1, A2, A3}, and the dependency edge set E contains only A1→A2, thus forming the action dependency graph G (Version 1); A1, etc. in the set represent the abbreviation of the corresponding action instance.
[0033] S102. If no final state receipt is received for the tool call request, the effect item corresponding to the tool call request is set to "unknown effectiveness" (meaning the actual execution result of the tool call request is uncertain, not that the tool call request has failed). Using the action to which the effect item with "unknown effectiveness" belongs as an uncertainty seed, propagate along the dependency edges and constraint groups in the action dependency graph to determine the set of actions and resource ranges that need to be isolated, and then generate an isolation record. The isolation record is used by the execution gateway to prevent repeated tool call requests for the same resource and the issuance of subsequent actions that depend on the execution result of the tool call request (i.e., prevent the issuance of training submission action A2). Independent branch actions that do not intersect with the resource range of the isolation record and have no common pause constraints continue to execute, i.e., do not prevent independent inspection reading action A3. And generate a verification item containing action instance, effect item identifier, original operation identifier, contract version and reason. Step S102 is completed by the execution gateway and the persistent ledger.
[0034] S103. The evidence verifier verifies the actual response execution result of the tool call request based on the original operation identifier and contract version in the item to be verified, rather than re-initiating the tool call request, and obtains the verification evidence record; the verification result directly updates the isolation set and the recovery set, retains the valid branch when the boundary dependency is verifiable, and reduces unnecessary compensation and re-inference; the difference from simple sequential rollback is that the recovery decision is constrained by the effect evidence.
[0035] S104. Based on the verification data record, determine each effect item as having occurred, not having occurred, or unknown, and generate an effect determination record, which includes the overall status of being effective, not effective, partially effective, and unknown in effect, as well as the action type of business action and compensation action; provide the effect determination record of action type business action to step S105, and provide the effect determination record of action type compensation action to step S106. The following methods are used to determine whether each effect item has occurred, is definitely not occurred, or is unknown: If there is evidence of completion covering all promised changes for the effect item, the effect item is determined to have occurred; if there is both evidence of non-occurrence and grounds for termination of the request to prevent the subsequent effect from taking effect, the effect item is determined to have not occurred; if there is evidence of non-occurrence but no grounds for termination of the request to prevent the subsequent effect from taking effect, the effect item is determined to be unknown; if there is conflicting evidence or missing evidence, the effect item is determined to be unknown.
[0036] The overall status is determined as follows: Using the set of necessary effect items determined according to the tool effect contract at the time of action registration as the summary scope, the overall status is determined according to the following rules: If all effect items in the set of necessary effect items are determined to have occurred, the overall status is effective; if all effect items in the set of necessary effect items are determined to have not occurred, the overall status is ineffective; if at least one effect item in the set of necessary effect items is determined to have occurred, at least one effect item is determined to have not occurred, and no effect item is determined to be unknown, the overall status is partially effective; if any effect item in the set of necessary effect items is determined to be unknown, the overall status is effective but unknown. For the overall status of "effective but unknown," the individual determination details of all effect items are retained, where effect items determined to have occurred are not downgraded to unknown due to lack of termination request basis.
[0037] Step S104 also includes generating a read determination record for a pure read action without external write effect, which includes a read status that distinguishes between valid result, invalid result, and pending verification. S103 and S104 are completed by the evidence verifier. The read determination record of the pure read step S104 is provided to step S105 with the result valid or invalid branch, and the pending verification branch continues verification or is suspended.
[0038] "Effected," "Not yet effective," and "Partially effective" are considered "determined" states. "Effectiveness unknown" is considered "unknown" and "unknown" states only enter the "Continue Verification" or "Pending Verification" branches.
[0039] S104 selects the recipient based on the business or compensation type in the action log. The ineffective, effective, and partially effective status of business actions are all submitted to S105 to determine the processing type; retry or completion approved by S105 is registered and issued by S101. When an executable compensation item is first received in S106, it is issued, and the receipt proceeds to S102 through S104; upon subsequent receipt of the compensation item's determination, only the original processing item is updated, and it is not reissued due to a return to S106. Unknown items do not enter the repeatable issuance branch, and compensation confirmation does not generate a "revoke compensation" plan. If issuance fails in S107, the original control state continues; new evidence or target events can re-trigger S103 or S105. Specifically, the action type of the effect determination record in step S104 is inherited from the action type determined when the corresponding action record is registered: the action record registered by the execution gateway according to the tool action proposal has a business action type; the new action record registered by the execution gateway for the processing item in the recovery plan is associated with the original action and its effect item, and its action type is a compensation action, which is associated with the stability compensation identifier and references the original recovery plan processing item. It is important to note that step S104 is not executed only once. The action type is a static attribute read from the registered action record during each determination; it is not derived in step S104 on the spot, nor is it determined at some global moment. Each determination in S104 applies to a registered action instance: when determining A1, the type (business) is read from the A1 record; when determining CP-01, the type (compensation) is read from the CP-01 record. The types for the two determinations originate from different sources, but are both determined in the registration steps preceding their respective determinations. The action type of each action instance remains constant throughout its lifecycle; the determination record simply inherits and carries it.
[0040] Step S104 provides the effect determination record for actions of the business type to step S105, whereby step S105 determines the processing type based on the overall status and the task objective record. Step S106 provides the effect determination record for actions of the compensation type to step S106, whereby step S106 references the original recovery plan and processing item identifier to confirm or continue verifying the original processing item, and does not treat the compensation action as a processing item for generating reverse compensation in case of business failure. If the compensation effect is unknown, steps S102 to S104 are re-executed. The compensation uses the original action attribution evidence and downstream conditions to reduce the risk of misselecting objects and overwriting external concurrent modifications. Isolation is maintained when concurrency protection cannot be obtained to avoid making invalid recovery guarantees.
[0041] Verification evidence records preserve externally observed facts, while effect judgment records preserve conclusions drawn based on these facts and contractual rules; the two are linked through evidence identifiers and are not interchangeable. In the following text, "evidence" refers to verification evidence records or fields explicitly indicated therein, "recovery controller" refers to the isolation and recovery controller, and "context revision module" refers to the evidence invalidation and context revision module; the recovery plan, recovery result record, and continuation execution status package correspond to the content to be processed, the verified processing results, and the control data intended for subsequent execution, respectively.
[0042] S105. The isolation and recovery controller, based on the overall state in the effect judgment record of action type business action and the task target record, determines the effect items that need to be canceled, retried under control, or supplemented, and their corresponding action instances, and propagates them in the action dependency graph to form a recovery set and a proposed retention set. Specifically, for effect items whose overall state is "effective" and the task target record requires the corresponding effect to be retained, their corresponding action instances are included in the proposed retention set; for effect items whose overall state is "effective" and the task target record has canceled the corresponding effect, a processing item with a processing type of conditional compensation is generated; for effect items whose overall state is "ineffective" and... The task objective record requires the execution of a write action with a corresponding effect, generating a processing item with a controlled retry type. For effect items whose overall state is ineffective and whose corresponding effect has been canceled in the task objective record, action proposals that have not yet been issued are discarded. For actions whose overall state is partially effective, processing items with a single-item completion type are generated only for the effect items that are determined not to have occurred, and the effect items that have occurred and their verification evidence records are retained. For actions whose overall state is unknown in terms of effectiveness, they remain isolated and do not enter the recovery set. The action instance corresponding to the generated processing item is used as a seed and propagated along the action dependency graph to form the recovery set. Boundary verification is performed on the recovery set and the set to be retained to generate a recovery plan containing processing type, version reference, and boundary verification results. The control revision number corresponding to the recovery plan is registered. The control revision number is the version identifier of the current control state in the execution gateway's local persistent ledger, which increments as the isolation scope increases or the continued execution state package is successfully released. Before the recovery is issued, the impact scope of the processing item is incorporated into the isolation record and persisted. If the isolation scope is expanded, the control revision number is incremented. If the existing isolation covers the entire scope, the current control revision number is reused. The recovery plan saves the control revision number after isolation registration. If new verification data, action dependency graphs, or changes in task target records occur after registration, the recovery plan is re-verified. Specifically, the isolation and recovery controller compares the verified effect with the current target predicate to determine whether the effect should still be retained; the recovery plan saves the target version it is based on. An action instance is a registered execution attempt, including attempts that have not yet been issued; the same logical action can be associated with multiple attempts, but multiple attempts cannot be merged into a single effective fact. An effect item is an external change under an action instance; action sets do not directly contain effect items or evidence records.
[0043] Step S105 further generates failure handling or re-reading processing items for read judgment records with invalid read status, determines the action instance to which the read judgment record belongs, and propagates along the action dependency graph with the action instance as a seed to be included in the recovery set; for read judgment records with valid read status, the action instance to which it belongs participates in the retention verification of the proposed retention set. If the verification passes, it is included in the proposed retention set; if the verification fails, it continues to be isolated; for read judgment records with pending verification status, verification data records continue to be obtained. If the verification data records are still insufficient, the action instance to which the read judgment record belongs continues to be isolated.
[0044] Furthermore, following any one or a combination of the aforementioned technical solutions, step S105, which involves boundary verification of the recovery set and the proposed retention set, includes: comparing the resource change range of each processing item in the recovery set with the input evidence, control premises, resource version, and constraint group of the action in the proposed retention set, and performing boundary verification item by item. If the resource change range does not intersect with the dependency range of the action in the proposed retention set and the constraint group allows it to exist independently, then the boundary verification passes. If the resource change range of the processing item in the recovery set intersects with the dependency range of the action in the proposed retention set, then based on the tool effect contract, it is determined whether the dependency predicate of the action in the proposed retention set still holds after the processing item is executed. If there is current evidence supporting this determination, then the boundary verification passes. If there is no current evidence supporting this determination, then the boundary verification fails.
[0045] Completed consumption actions that fail boundary verification are added to the recovery set, while completed consumption actions that cannot be determined by boundary verification remain isolated.
[0046] S106. Based on the effect determination record of the action type being a compensation action, execute the processing items corresponding to the recovery set according to the recovery plan, including: for processing items that need to be re-executed, register new attempts associated with the original processing items, and update the original processing items after issuance and verification; for effective effect items that need to be revoked, perform conditional compensation and verify the compensation effect; if the compensation effect is unknown, re-execute steps S102 to S104; summarize the verification results of each processing item and the processing items that have not been verified to generate a recovery result record; steps S105 and S106 are completed by the isolation and recovery controller through the same execution gateway, and step S105 is registered for isolation according to the processing item before the recovery is issued.
[0047] S107. Based on the recovery result record and the set to be retained, generate a continued execution status package to be released. The recovery result record is used to locate the verification evidence corresponding to the effect item to be revoked. The continued execution status package includes a valid reference index generated from the verified valid outputs in the set to be retained; a list of invalid evidence located by the original verification evidence corresponding to the revoked effect item and the invalid reading judgment; the scope of invalid derived content determined layer by layer along the evidence reference relationship; a set of prohibited actions obtained by summarizing and deduplicating restricted actions, incomplete items, and subsequent actions that still reference invalid evidence in the isolation record; and the remaining isolation scope. In the same local commit, verify the version reference and control revision number of the recovery plan. After all matches, release the continued execution status package as an execution gateway. The current control state is used, and the original isolation is maintained when the release fails. The execution gateway verifies the reference and issuance conditions of subsequent actions based on the released current control state. It rejects the issuance of tool action proposals that reference credentials or parameters in the invalid evidence list. For valid outputs already released in the valid reference index, subsequent actions are allowed to use them as long as the current task target record and preconditions are still met. After release, the termination conditions are checked again. If the target effect is met, the dependency is valid, and there are no pending isolation items, it is marked as successfully completed. If the recovery process is completed, there are no related unknown effects, and the contract-permitted safety state is reached, it is marked as recovery terminated. If there are still unknown effects, version conflicts, or incomplete release, the corresponding isolation is retained and marked as pending verification, thus realizing a closed loop of execution verification, dependency subgraph recovery, and continued execution control. S107 is released after reviewing the referenced version in the same commit. S107 is completed by the context revision module and the gateway's persistent ledger. The continuation status packet carries the control revision number read at creation time. If the control revision number read at creation time is consistent with the current control revision number in the same local commit, the commit is made and the control revision number is incremented. If they are inconsistent, the commit is rejected, the original isolation is maintained, and the continuation status packet is recalculated.
[0048] The purpose of reviewing the control revision number is to prevent old packets from overwriting new isolations: if a new isolation event occurs before release (the control revision number has changed to 8), it means that the gateway control state has been changed by other events. The old packet is calculated based on the expired state - if the review does not match, the release is rejected. Otherwise, "the old state is used to overwrite the new isolation", and the new isolation is swallowed up.
[0049] Step S107 generates the continued execution status package to be published, including: The evidence invalidation and context revision module reads the recovery result record, locates the corresponding original core verification evidence from the revoked effect item and the read judgment record with the read status being invalid, generates a pending invalidation mark, generates an invalid evidence list from the pending invalidation mark, and determines the invalidation scope of the derived content layer by layer along the evidence citation relationship until there are no more new derived objects. A valid reference index is generated from the verified valid outputs in the set to be retained. The index entries of the valid reference index are associated with evidence identifiers, actions, and available fields. References to be invalidated are not included in the valid reference index. The prohibited action set is obtained by summarizing and deduplicating the restricted actions in the isolation record, the unverified completed processing items in the recovery result record, and the subsequent actions that still cite invalid evidence; The pending execution status package is generated from the valid reference index, the list of invalid evidence, the remaining isolation range, the set of prohibited actions, the current target version of the task target record, the current plan version of the recovery plan, and the control revision number read at creation. During the generation process, the current control state of the execution gateway and its control revision number remain unchanged.
[0050] The continued execution status package also includes the following after successful publication: The execution gateway verifies subsequent actions based on the published current control state: it rejects the issuance of tool action proposals that reference credentials or parameters in the invalid evidence list; and it allows the issuance of subsequent actions that use valid outputs in the valid reference index, provided that the current task target record still requires the corresponding effect and the premise for using the valid output has not been revoked. After publishing the continued execution status package, check the termination conditions again: if the target effect is met, the dependencies are valid and there are no pending isolation items affecting the target, mark it as successfully completed; if the recovery process is completed, there are no related unknown effects and the safe state allowed by the tool effect contract is reached, mark the recovery as completed; if there are still unknown effects, version conflicts, known effects that cannot be safely processed, or the release is not completed, mark it as pending verification and retain the corresponding isolation.
[0051] The action record in step S101 includes a logical action identifier, an attempt identifier, and an original operation identifier. The content it saves is to persist the proposal, contract version, and existing input references, and to assign logical actions and attempt identifiers. Its subsequent use is to locate and call in step S102, and to obtain the original operation identifier in step S103, so that subsequent records are associated with the same attempt.
[0052] The verification evidence record in step S103 is associated with the effect item identifier in the item to be verified. The verification evidence record includes resource identifier, resource version and final state flag. The content it stores is fact fields extracted from archived receipts or read-only query responses according to action records and contracts. Its subsequent use is for item-by-item judgment in step S104 and for extracting the real compensation object and version in step S106. The resource version is provided by the remote tool.
[0053] The isolation record in step S102 stores the affected range based on the unknown marker and the determination. Its subsequent use is to prevent the gateway from sending conflict information and to provide the scope to be removed in step S107. The effect record in step S101 saves the expected changes from the proposal and contract instantiation; the actual results are pending confirmation or query binding. Its subsequent use is to verify whether an event has occurred, whether it has not occurred, or whether it is unknown on a single item basis.
[0054] The effect determination record in step S104 saves the determination and evidence reference of all necessary effect items of a certain action instance. Its subsequent use is to generate the overall four states of the action, locate isolation and restore seeds.
[0055] The action dependency graph in step S101 includes action nodes, parameters and resource dependency edges, and constraint groups. Its subsequent use is to propagate the affected range and to carry the generation basis of each edge.
[0056] The recovery plan saved in step S105 includes the processing items calculated based on the effect judgment, the diagram, and the target version; the set of actions that need to be recovered or recalculated; and the set of completed actions to be retained in the recovery plan. Its subsequent use is to constrain the issuance of recovery measures; plan generation does not indicate that processing is complete.
[0057] The recovery result record in step S106 saves a summary of the verified processing results, incomplete items, and original evidence references. Its subsequent use is to generate the scope of evidence invalidation and the status package to be released.
[0058] The content saved in the continued execution status packet in step S107 is the result generated based on the recovery result, valid references and remaining isolation range. Its subsequent use is to verify and publish it to become the current control state of the gateway.
[0059] The current control state is the isolation scope, valid reference index, prohibited action set, and control revision number actually used by the gateway in its local persistent ledger; it is not a mirror of external tool resources. Isolation records and recovery plans can exist first, but the planned scope to be removed only takes effect on the gateway after being published via S107. Increasing isolation takes effect immediately upon persistence; decreasing isolation requires waiting for the corresponding scope's evidence to expire, version verification, and state publication to complete.
[0060] The control revision number belongs to the local gateway control state and increments each time an isolation is added or a new state is released; the version reference of the recovery plan includes the action dependency graph version, the decision version, and the target version; version consistency is defined as "the referenced version of the same object is consistent with the current version", not that the version numbers of these different objects are equal to each other.
[0061] In steps S102-S107, the currently effective unknown action set records actions whose reservation status is uncertain; the currently isolated action set records actions that need to be isolated; the currently recoverable or recalculated action set records actions that need to release reserved or invalidated proposals; and the recovery plan's set of completed actions to be retained records the completed actions that can be retained. Their specific members are generated by the evidence and rules of each step and are not pre-specified during task registration. The single-round verification time budget, the maximum number of verification calls per action, and the maximum visibility delay of the tool contract declaration are taken from the verification configuration and the tool contract, respectively. The recovery plan version is generated by the recovery controller and updated with re-verification. The current version of the action dependency graph with version, the recovery plan version, the task target version, the local control revision number, and the resource group version returned by the resource system belong to different objects and are not compared for numerical equality.
[0062] The calculation of the set of actions currently requiring isolation adopts a fixed-point process: initially, actions currently in effect but unknown are included, actions referencing invalid evidence, actions in transit that conflict with unknown writes, and actions belonging to processing items registered for isolation recovery in step S105 but not yet completed or lacking the conditions for release; this process is expanded along output consumption, read / write, and control dependencies; if a constraint group requires members to collectively pause, relevant members of that group are included; this process is repeated until the set no longer changes. Completed recovery processing items with release criteria are no longer considered seeds for a new round of candidate sets of actions currently requiring isolation; the gateway's current isolation remains until successful publication in S107. Each action on the finite graph is added at most once for the first time, and the basic propagation cost of traversing the adjacency list is proportional to the sum of the number of nodes and edges; constraint group scanning cost is also included.
[0063] The current set of actions requiring recovery or recalculation is not directly equal to the current set of actions requiring isolation. After verification, instances of original actions requiring undoing, controlled retries, single-item completion, or rereading / recalculation, as well as instances of actions consuming invalidation evidence, are used as seeds for similar propagation; then, the constraint group is used to check whether related upstream operations need to be included. Only actions that no longer require the above recovery processing, have been completed, and can independently satisfy the constraints can be removed from the recovery candidate, and their retention conditions still need to be passed item by item.
[0064] The actions in the set of completed actions to be retained in the recovery plan must be completed, effective, with valid evidence versions, and satisfy boundary constraints; it is the result of the recovery plan's calculation and does not directly change the gateway's access status. For each boundary dependency between the set of completed actions to be retained in the recovery plan and the current set of actions to be recovered or recalculated, it must be proven that the recovery of the current set of actions to be recovered or recalculated will not delete the resources that the set of completed actions to be retained in the recovery plan depends on or change their premises; if this cannot be proven, the current set of actions to be recovered or recalculated should be expanded or the boundary isolation should be maintained. What is obtained here is a closure under the rules, and a globally minimal recovery set is not claimed.
[0065] Each round of the isolation closure takes the previous round's set as input, extracts newly added nodes one by one, traverses their dependent successors and constraint group members that need to be paused together; nodes not in the set are enqueued. The process stops when the queue is empty. The recovery closure also uses a queue. The seed contains the original action instances that need to be undone, retried under controlled conditions, completed individually, or reread or recalculated, along with their failed consumer nodes; unknown effects first enter the isolation set through their respective action instances and are not automatically added to the executable compensation list. Constraint groups can include upstream nodes when they require joint recovery. The current set of actions to be recovered or recalculated is defined at the action instance level. Within the plan, retention, retry, completion, or undone is still distinguished by effect item; for pure reads, retention or reread is distinguished by the read object. Adding a node to the current set of actions to be recovered or recalculated cannot be interpreted as undone all effects of that node.
[0066] Within the same stable graph version, the generation process of the action set that needs to be restored or recalculated only adds nodes, and continues to expand until no more nodes are added when the boundary fails. If new evidence allows for narrowing the scope, the entire candidate set is recalculated based on the new judgment version, instead of directly deleting nodes from the old plan currently being executed. The set of completed actions to be retained in the restoration plan is mutually exclusive with the action set that needs to be restored or recalculated. Completed nodes that are outside the action set that needs to be restored or recalculated but cannot pass the retention verification are neither part of the set of completed actions to be retained in the restoration plan nor are they granted permission to continue execution. The action set that needs to be isolated can simultaneously cover the node to be verified and its successor, and is not required to be mutually exclusive with the action set that needs to be restored or recalculated.
[0067] When the set of currently effective unknown actions is empty and there are no other isolation seeds, the set of actions for recalculated candidate isolation is empty; the isolation range that has already taken effect on the gateway can only be reduced after S107 is successfully published. When there are no actions that need to be undone, retried, completed, reread, recalculated, or invalidated, the set of actions that need to be restored or recalculated is empty, but the results are still verified and retained item by item. When there are no nodes, an empty plan is returned, and compensation is not invoked. An empty set of effect items is only valid for pure read actions; the "all effect items successful" empty set judgment is not used to determine the success of write actions.
[0068] The following detailed explanation of steps S101-S107 will be based on specific examples of reserved action A1, training submission action A2 that has not yet been issued, and independent inspection reading action A3: Regarding step S101 (Action Registration and Dependency Fixation): The first version of the objective of task T1 is read: "Reserve 3 GPU servers in computing cluster CL-G01 that meet the configuration requirements listed in the task for training job JOB-01, submit training to the scheduler after obtaining valid reservation credentials; simultaneously query the device status of independent backup storage cluster BK-01 in read-only mode and generate a local inspection summary," as well as the resource request proposal, tool effect contract, and current control status of reservation action A1. The corresponding tool action proposal specifies training job JOB-01, computing cluster CL-G01, a quantity of 3, and the configuration conditions required by the task. In this example, the contract defines querying the allocation result by operation identifier, and uses "a certain allocation slot has been bound to a server that meets the configuration requirements and belongs to training job JOB-01, and the reservation status is reserved" as the completion condition for this effect item. The first attempt A1-1 and operation identifier OP-01 of gateway registration A1 are executed, and the three required effect items are registered as A1-E1 / slot1, A1-E2 / slot2, and A1-E3 / slot3, respectively. At this time, the actual equipment, reserved group, reserved credentials, and resource version are still unknown. The relevant fields remain to be bound, and the expected quantity of 3 cannot be written as evidence that 3 servers have been obtained.
[0069] The execution gateway simultaneously registers the references to the parameters to be parsed for training submission action A2: the reserved credentials and device list required for training submission must come from the valid output of A1. Therefore, A2 is not issued at this time if the state of A1 is uncertain. A3 is registered according to the pure read contract, and the read object is the device state of the independent backup storage cluster BK-01. No external write effect items are generated (i.e., it does not depend on the valid output of A1). The graph manager forms the first version of the action dependency graph G based on these parameter references and resource scope, and persists it together with the action record, effect item record, and the issuance intention of A1. OP-01 is sent to the resource system only after the registration verification is completed; the action record and receipt or no receipt exception are submitted to step S102, OP-01 and contract version are available for step S103 to query, the expected conditions of the three effect items are available for step S104 to compare item by item, and the action dependency graph G is used for subsequent calculation of isolation and recovery scope. The first execution uses the initial valid input and the current control state, and subsequent actions also read the published continuation execution status package.
[0070] This example breaks down the effect items into three allocated quotas that can be verified separately according to the contract. Each item records the target resource scope, expected changes, query rules, and recovery method; the correspondence between the actual server and the quota will be provided by subsequent evidence. If other tools only guarantee that the entire application is a single indivisible submission unit, then the overall effect items should be registered according to their contract, and the three-item breakdown in this example cannot be copied. Before distribution, capture the actual input evidence and version used, and submit the dependency edges along with the intent record. Intent must precede distribution to avoid execution without a recoverable record. When the resource version is not obtained and the tool cannot guarantee exclusivity, snapshot differences should not be used as the sole basis for effect attribution.
[0071] Regarding step S102 (uncertainty detection and isolation): The resource system has processed action A1, but the connection was interrupted before the gateway received the final state acknowledgment. S102 reads the initial attempt to distribute A1-1 and finds that there is already a distribution intention for OP-01 but no reliable final state. Therefore, it registers a pending verification mark for the three effect items A1-E1 to A1-E3. At this time, it is unknown whether the allocation was successful, and it is not possible to request three more servers. Using A1 as the uncertainty seed, we obtain U={A1}. Propagating along the A1→A2 dependency in version 1 of G, we obtain the current set of actions that need to be isolated, Q={A1, A2}. The gateway registers the isolation of the resource request scope of A1 and the subsequent submission of A2, updating the local control revision number from 6 to 7. The independent inspection reads that action A3 accesses the independent backup storage cluster BK-01. This scope does not intersect with A1 and there is no common pause constraint. Therefore, A3 will not be paused due to the A1 anomaly. This achieves conservative and precise blocking during the period of uncertainty, avoiding a complete task shutdown.
[0072] S102 assigns the initial attempt A1-1, three effect item identifiers, operation identifier OP-01, contract version, and the reason for "missing final state receipt" as a verification item to step S103; the isolation record saves the graph version and reason reference, for the gateway to restrict the issuance and for step S107 to check the basis for lifting. The unknown marker here only serves a conservative blocking function; the formal effect judgment record is still generated by step S104 based on the verification evidence. For pure reads, the verification item is changed to associate the read object and field range, the effect item identifier is empty, and step S103 obtains evidence according to the read contract.
[0073] When timeouts, response parsing failures, missing key fields in the receipt, asynchronous operations still being processed, or responses conflicting with external states occur, set the relevant effect items to unknown. Pause the delivery of dependent actions and set runtime isolation flags for resource scopes.
[0074] For completed actions that reference unknown or overturned results, only mark them as "pending review" and do not immediately compensate for them. For actions that are in progress and cannot be withdrawn, add verification tasks; the results of these actions can continue to expand the currently effective set of unknown actions and the set of actions that need to be isolated. Non-conflict branches must undergo boundary verification before they can continue.
[0075] Regarding step S103 (verification path selection): Step S103 reads the A1 verification item submitted in step S102 and queries the resource system using OP-01 according to the contract, instead of resubmitting the resource application. The first query only returns "processing", forming evidence EV-01, which is still insufficient to confirm the results of the three slots after step S104. After step S104 returns the request to continue verification, the second query obtains the final response: belonging to training job JOB-01, computing cluster CL-G01, releasing reserved group GR-01, slot1 / slot2 / slot3 are mapped to GPU-S01 / GPU-S02 / GPU-S03 respectively, all three slots meet the required configuration and the status is reserved, reserved certificate RC-01, resource group version 8. The verifier extracts these fields according to the contract and verifies the attribution of OP-01, forming evidence EV-02; the real device identifier and slot mapping are obtained from this response and are not filled in by the model.
[0076] Evidence EV-02 is associated with effect items A1-E1, A1-E2, and A1-E3 respectively, for step S104 to compare the actual allocation with each expected condition; resource group version 8 is subsequently used for constraint release operations. The read receipt of independent action A3 forms evidence EV-03 according to its read contract, associated with A3 and the read object of independent backup storage cluster BK-01, with the effect item identifier empty, for step S104 to determine whether the read result is valid. Step S103 directly extracts evidence from existing qualified receipts, only initiating read-only queries when evidence is insufficient, and saving fields such as source, collection time, contract version, and available source version; it cannot only transmit a summary without field attribution.
[0077] Select according to the following deterministic order: First, query the authoritative final state by the original operation number; second, query immutable event records containing the original action's associated identifier; third, use resource snapshots with version, exclusivity, or conditional commit proofs. Aggregate counts that cannot be uniquely attributed are only used as clues and are not used to confirm the effect of this action.
[0078] Among candidates of the same level, interfaces that can cover more undetermined effect items are prioritized, and then tied candidates are broken down by configured call costs and historical latency. Verification results are added sequentially, and the budget only limits the number of calls and waiting time, without relaxing the validity of the evidence.
[0079] For eventually consistent interfaces, continue waiting if the query is empty within the maximum visibility delay declared in the tool contract. Even if the maximum visibility delay declared in the tool contract is exceeded, it cannot be considered ineffective unless there is evidence that the original operation has been terminated, the request has been rejected without side effects, or the server has removed the barrier; this is because the original request may still arrive late and be executed.
[0080] Regarding step S104 (effect assessment and classification feedback): Step S104 first reads evidence EV-01; "Processing" does not prove that any quota has been completed or determined not to have occurred, therefore, judgment J-01 is generated: effect items A1-E1 to A1-E3 are all unknown, and the overall effect of action A1 is unknown. Continue isolation and return the items to be verified to step S103. After obtaining evidence EV-02, step S104 checks the operation attribution, the correspondence between slot and real server, training job JOB-01, configuration conditions, and reserved status item by item. All three effect items meet the completion conditions, generating judgment J-02: each item has occurred, and A1 as a whole has taken effect. The obtained reserved group, real device, and reserved certificate RC-01 are bound to the corresponding record. Parameter dependencies are refined with the mapping and merged into a graph update to obtain version G 2; at this time, U is empty, but the current isolation can only be lifted after S107.
[0081] For independent action A3, S104 reads evidence EV-03, checks the completion status and return fields of the contract according to BK-01, and generates a "Result Valid" read judgment record for step S105 to verify whether to retain it; A3 does not use the four states of write actions. J-02 and A3 read judgments are respectively used as inputs to step S105. Whether action A1 was actually successfully reserved and whether the target still requires continued training are two types of judgments; cancellation events cannot rewrite historical reservations that have already occurred as if they did not occur.
[0082] For actions involving external input, the set of required effect items must be non-empty and determined by the contract at the time of action registration. An item cannot be deleted if it is missing from the receipt. Each effect item has only three determinations: occurred, definitely not occurred, and unknown. There is no "partially effective" setting for individual items; if it is necessary to represent partial results separately, they should be pre-split into independently verifiable effect items in the contract. The overall status of the action is summarized in Table 1 below.
[0083] Table 1. Summary of Overall Action Status: The four conditions are mutually exclusive. Termination criteria are necessary conditions for determining whether something has not occurred; for items that have already been sufficiently proven to have occurred, they are not relegated to unknown status simply because no separate "termination proof of non-occurrence" is attached. Successful HTTP status, acceptance receipts, model self-descriptions, and identical parameters themselves do not constitute completion evidence. When some effects are known to be successful while others remain unknown, the overall effect is unknown, and all individual item details are retained.
[0084] By clearly distinguishing between ineffective and unknown states, and requiring grounds for termination of the original request, a recovery path that simply converts timeouts into repeated writes can be prevented. The effectiveness is conditional upon the authenticity of the contract and the evidentiary value of the tool.
[0085] A pure read action has no external write effect. Step S103 obtains a read receipt or attributable query evidence based on the action instance. Step S104 generates a read judgment record based on the read completion conditions and the validity of the returned fields in the contract, including the action instance, read status, returned evidence reference, judgment version, and reason. The read status is divided into: valid result, i.e., read completed and evidence conforms to the contract; invalid result, i.e., there is evidence proving read failure or the returned result does not meet the contract; pending verification, i.e., receipt is missing or evidence conflicts, and it cannot be determined yet. This record does not use the four states of write effect, nor does it deduce "effective" from an empty effect item set.
[0086] The read determination record, whether valid or invalid, is submitted to step S105: the former participates in the retention verification of the set of completed actions to be retained in the recovery plan, while the latter determines the invalidation scope of the old read reference and its derived results, and generates a reread processing item if the task still requires it. The item to be verified is supplemented with evidence in step S103; if the budget is insufficient, the isolation of its affected references is retained and the pending verification status is output. Re-execution of a pure read can generate new read attempts, but must not include undeclared write effects; if reads and writes are mixed, they are verified as actions with write effects.
[0087] The effect judgment record for writing actions includes the action type, logical action identifier, attempt identifier, individual item details, overall status, judgment version, and evidence references used. Step S104 passes the unknown items and reasons to step S103 for further verification and updates the isolation record according to the action dependency graph; the judgment of business actions in a deterministic state is passed to step S105, where the recovery seed and retainable results are located based on their individual item details and evidence references. The judgment of compensation actions is passed to step S106, referencing the original recovery plan and processing item identifiers. Step S106 confirms or continues to verify the original compensation based on this, and cannot treat it as a new business failure and perform reverse compensation again.
[0088] Regarding step S105 (restoring subgraph generation): Before training submission action A2 is issued, the task interface receives and confirms cancellation event CE-01, updating the training objective of task T1 from version 1 to version 2: cancel training job JOB-01, release the unconsumed reservations for the job, and prohibit training submission; the independent backup inspection objective is retained. Step S105 reads the objective version, determines J-02, evidence EV-02, the valid reading determination of action A3, and the action dependency graph G version 2, confirming that action A1 has indeed been successfully reserved but should no longer retain its occupancy effect. The original action A1 is located by the three effect items to be released by A1, and then the unissued training proposals are included along A1→A2, resulting in the current action set R={A1, A2} that needs to be restored or recalculated; A3 reads BK-01, whose evidence EV-03 and resource range are not affected by the release of reservation group GR-01, and there is no common success or failure constraint, so the set of completed actions to be retained in the restoration plan is K={A3}.
[0089] Step S105 generates Recovery Plan P Version 1: For A1, release the three unconsumed reserved slots belonging to training job JOB-01 in reserved group GR-01 according to the contract in this example; discard the proposal for A2 and invalidate its reserved parameter references; retain the read results and local inspection summary for A3. The plan references Action Dependency Graph G Version 2, Decision J-02 and A3's read decision, relevant evidence, Target Version 2, and Control Revision Number 7, and records the boundary verification basis that "the release scope is the reserved slots of this job in computing cluster CL-G01, and the read scope of A3 is independent BK-01". At this time, although the currently effective unknown action set U is empty, the recovery processing of A1 has not yet been completed, and A1 and A2 are still in the current action set Q that needs to be isolated; the previous isolation has covered the recovery impact scope, so Control Revision Number 7 is retained, and the recovery processing item is associated as the isolation reason. The plan is formed but the isolation is not lifted. The release processing item is handed over to step S106. The processing results of A2 discarding and A3 retaining, together with the subsequent release verification results, form the recovery result record.
[0090] Other processing types also use the same result delivery rules: Retrying, completing, or rereading processing items involves registering a new attempt in step S101, then verifying it in steps S102 to S104 and sending it back to step S105 to update the original processing item. When there is no external execution requirement, verified retained or invalid results are directly written as a recovery result record and submitted to step S107, listing any incomplete items. The record must reference the recovery plan version, processing item, and supporting judgments; it cannot omit the input from step S107 or presume task completion due to "no compensation."
[0091] Based on the verification results and the current effective objectives of the task, generate the current set of actions R that need to be restored or recalculated, and the set of completed actions K to be retained in the restoration plan. For each action, specify the processing type: retain effective effects, discard unissued proposals, invalidate read or calculation results, conduct controlled retries to determine ineffective write actions or re-execute pure read actions that require re-retrieval of results, complete items in composite actions that have not occurred, or conditionally cancel effects that have occurred. Each processing item records the action instance, effect item (pure read is changed to read object and field range), judgment and evidence referenced, execution preconditions, and expected completion conditions; "entering the restoration scope" should not be directly equated with "performing compensation."
[0092] Controlled retries for write actions must satisfy the following conditions: the task objective remains valid, the prior evidence is valid, and the original attempt cannot produce new effects. Retry uses the original logical action identity and creates a new attempt identifier; if the downstream supports idempotency, it uses the identified logical idempotency key; otherwise, retry is premised on the original attempt having terminated. When partially effective, only complete proposals are generated for effects that have not yet occurred, binding the verification evidence for that item and the items that have occurred, and re-checking their cross-item constraints; any unknown item prevents the entire composite action from being replayed. If the objective has been cancelled, retrying is not allowed for ineffective items.
[0093] For directed graphs, compensation is performed in reverse topological order. When cyclic dependencies occur, strongly connected components are calculated first, and each component is treated as a recovery unit; each unit must have a pre-registered and verifiable joint compensation process, otherwise, isolation is maintained. A node in the cycle cannot be arbitrarily selected for initial removal.
[0094] Boundary verification is performed based on the actual write fields of the recovery plan: First, it summarizes the resources and fields that will be changed by each controlled retry, undo, supplement, or replacement repair in the current action set R that needs to be recovered or recalculated; then, it reads the input evidence, control premises, resource version, and constraint group to which the node to be retained belongs. If the recovery write set and the dependency scope of the retained node do not intersect and the constraint group allows it to exist independently, then the item passes; if they intersect, the contract must prove that the dependency predicate still holds after recovery, and there must be current evidence to support the proof, otherwise it fails. In this example, action A2 submits training requiring the reservation corresponding to reservation certificate RC-01 to still be valid. After releasing reservation group GR-01, the premise no longer holds, so A2 cannot be retained; A3 only reads the status of the independent backup storage cluster BK-01. Releasing the reservation in the computing cluster CL-G01 does not change its input premise and there are no common constraints, so it can be retained. Edge checks are performed on both inbound and outbound R. Retaining objects generated upstream must also satisfy the constraint of independent existence after recovery.
[0095] Completed consumption nodes that fail at the boundary are added to the current action set R that needs to be restored or recalculated. If the failure to determine the outcome is due to unknown reasons, isolation is maintained; compensation should not be provided immediately simply because the node cannot be retained. After the boundary is cleared, the validity of the evidence and resource conditions are still checked during execution. If external concurrent version changes cause the checks to fail, the branch is stopped, and the process returns to step S103 for re-verification. Subsequent actions that have not yet been issued are not included in the set K of completed actions to be retained in the recovery plan; they are executed separately once the release conditions are met.
[0096] Before the first recovery is issued, step S105 incorporates the original actions, actual resource field ranges, and conflict successors propagated along dependencies of the pending or unexecuted processing items in the action set R that needs to be recovered or recalculated into the current isolation record, recording the recovery plan and processing items as the cause. This step also applies to situations where the effect is known but the goal is canceled, without requiring the currently effective action set U to be non-empty. When an isolation scope is added, the control revision number is persisted and incremented; when an existing isolation covers the entire scope, the current revision number is reused. The controller then reviews the plan under the same current graph and goal conditions, saving the control revision number after isolation registration; recalculation is performed when new evidence, graph, or goal changes occur during registration. Actions already in progress within the scope are additionally verified and cannot be assumed not to have been executed; after registering a new recovery attempt, it is still verified again according to step S102.
[0097] The controller stores the recovery plan version P, the action dependency graph G version, the decision version, the target version, the control revision number, and the list of boundary evidence. When a new action, new evidence, target change, or resource version change occurs, the old plan must not be issued unconditionally; the recovery plan version P is updated after re-verification. Registering a plan as pending execution does not remove it from isolation, and the outputs of retained actions will not be published as new available prerequisites until the recovery results are generated.
[0098] Regarding step S106 (Conditional Compensation and Idempotent Restoration): Step S106 reads the plan generated in step S105, and obtains the release reservation group GR-01, training job JOB-01, three real devices and quota mappings, reservation certificate RC-01, and resource group version 8 from the evidence EV-02 jointly referenced by the three effect items of action A1, and constructs a conditional request to release the reservation for this job. The tool effect contract in this example explicitly assumes that the resource system can verify the version of the release reservation group GR-01, the belonging job JOB-01, and that the reservation has not yet been trained and consumed in the same atomic operation, and release these three quotas when the conditions are met; tools that do not have this capability cannot apply the conditional release guarantee of this example. The stability compensation identifier CP-01 is associated with the same group of release semantics and effect items A1-E1 to A1-E3, indicating a single group release, not repeatedly sending the same group of release requests to the three devices separately.
[0099] After registering the compensation attempt, a compensation node and its underlying relationships are added to the graph, and the action dependency graph G is updated to version 3. The recovery controller re-verifies the original plan's scope of action, evidence, and target version 2 on the action dependency graph G version 3, and updates it to recovery plan version P version 2; the existing isolation has covered the release scope, and the control revision number remains 7. After verifying the current plan and preconditions, the gateway only allows the compensation request, and action A2 still cannot be submitted for training. The release receipt or subsequent read-only query is verified through steps S102 to S104, forming evidence EV-04: the release reservation group GR-01 corresponding to the stable compensation identifier CP-01 has released three reserved slots for this job, with the status released and resource group version 9; step S104 generates compensation judgment JC-01 based on this and sends it back to step S106.
[0100] The recovery controller, based on compensation decision JC-01, marks the relevant dependency edges after the effect is revoked as needing to be reviewed and updated in the graph version. It then re-verifies and updates the recovery plan version P (version 3), referencing the current graph version after this update, the current decisions for each action, and the target version 2, forming the recovery result RR-01. RR-01 records that the release processing of the three effect items of action A1 has been verified as complete, the A2 proposal has been discarded and its references are pending invalidation, and the A3 result is retained. It also associates evidence EV-02, EV-03, EV-04, and each processing item, and submits this information to step S107 to determine the scope of invalidation and the content to be released. Action A1's previously successfully reserved J-02 is retained as a historical decision. Resource versions 8 and 9 describe the state before and after release, respectively. Processing items with unknown compensation, version conflicts, or that are not yet completed must remain in the recovery result and cannot be recorded as completed.
[0101] Compensation parameters are extracted from the original action's actual response or attributable query, and are not replaced by object identifiers regenerated from the model. If compensation requires modification of shared resources, the expected version is included in the call, and the downstream processes compare and modify the version within the same atomic operation.
[0102] When a version conflict occurs, stop compensation for that branch and re-verify the external state; if the original action's effect and subsequent legitimate writes cannot be distinguished, do not directly restore the old snapshot. For irreversible effects, choose alternative repairs or manual handling explicitly permitted by the contract; do not falsely claim that a rollback has been achieved.
[0103] Each compensation is assigned a stable compensation identifier, which is bound to the original action, effect, and compensation semantics. This identifier is reused when retrying the same compensation; changes in the plan version alone should not generate a new compensation identity. If the compensation target or scope is changed, it must be registered as a new compensation action and proof must be provided that it has not been covered by the old compensation.
[0104] Step S106 receives the four-state determination of the compensation action from step S104: Only when all necessary effect items are determined to have occurred and the entire process is deemed effective, is the compensation processing item marked as verified as completed; if the overall effectiveness is unknown, verification continues; if the entire process is ineffective, the original request termination and retry conditions are re-examined. If the entire process is partially effective, the determinations and evidence for each effect item are retained, the entire processing item remains incomplete, and the relevant scope remains isolated; only when the original compensation contract allows independent completion and the incomplete item is confirmed not to have occurred, is a completion attempt associated with the original processing item generated for that item and confirmed along the same verification process. The completion attempt is still registered as a compensation type, and its determination is sent back to step S106 from step S104; step S106 maps the confirmed effects of the original compensation and the new evidence from the completion attempt item by item to the original processing item completion conditions, marking the processing item as complete only after all conditions are met, while the historical partial effectiveness determinations of the original attempt remain unchanged. If independent completion is not allowed, the process remains pending verification, and the completed compensation effect is not replayed or revoked again. If the compensation response is uncertain, proceed to steps S102 to S104 again; the original action must not be prematurely set as compensated. The expiration of a worker's lease only allows other workers to take over verification; it does not mean that remote execution has stopped. Reissue is not allowed if downstream idempotency or barrier capabilities are lacking.
[0105] Regarding step S107 (Status Release and Completion Verification): Step S107 reads RR-01 and its referenced recovery plan version P, version 3, evidence EV-02 to EV-04, and the current judgment to generate a release-ready continued execution status package: the device list in reserved certificate RC-01 and evidence EV-02 is no longer a prerequisite for submitting training job JOB-01; the A2 parameter reference and the derived summary referencing these old prerequisites are included in the list to be invalidated; the local inspection summaries of evidence EV-03 and A3 are retained; evidence EV-04 and the original reserved record are retained for verification and auditing. The recovery processing of A1 and A2 has been completed and released, and is no longer used as a seed for a new round of candidate isolation sets (i.e., the current set of actions Q that need to be isolated), and the remaining isolation range is empty; however, action A2 has been cancelled and is still included in the prohibited action set. Releasing resource isolation should not be interpreted as re-allowing the submission of training. When generating the release package, the gateway's current isolation and control revision number 7 remain unchanged.
[0106] S107, following the submission rules, verifies the current graph version referenced by Recovery Plan Version P, Version P, Version 3, the current judgment of each action, Target Version 2, and Control Revision Number 7 in the same local submission. It also submits the valid reference index, invalid index, prohibited action set, and remaining isolation range. Upon success, the Control Revision Number is updated to 8. If the version changes before submission or the submission fails, the original isolation state continues and recalculations are performed; gateway restrictions cannot be released prematurely. After successful publication, the training branch of Task T1 meets the recovery termination conditions of "this job's reserved space has been released, no training has been submitted, and there are no related unknown effects"; the independent inspection results of Action A3 are still usable. This completes the recovery after cancellation, not the successful execution of the training job.
[0107] Before release, each item is checked: all results in the package are supported by valid judgments; the planned referenced graphs, judgments, and target versions still match their respective current versions; there are no unverified write effects within the scope to be deactivated; all registered derived references requiring invalidation evidence have been processed; the boundary constraints after recovery are valid; the control revision number at the time of reading has not been changed by the new isolation event. If any check fails, the package remains pending release or is scrapped and recalculated, and the gateway retains the current control state without reducing isolation first and then performing additional checks.
[0108] In a single persistent ledger implementation, the current control state row, as well as the current version metadata rows of the recovery plan and its referenced graphs, decisions, and targets, are locked within the same local database transaction. While locked, the versions and old control revision numbers referenced in the package are reviewed until the commit is complete, at which point the lock is released. Updates to each metadata row follow the same transaction lock constraint; pre-checks cannot be performed only outside the transaction. After all matches are confirmed, the control effect flag of the recovery result, the valid reference index, the invalidation index of evidence and derived references, the remaining isolation scope, the set of prohibited actions, and the new control revision number are written together. If the commit fails, the above control updates are ineffective; the package is only provided to the agent after a successful commit, allowing the gateway to adopt the new version. Historical records of effects that have been remotely revoked can be appended beforehand and will not be overwritten as "remotely not revoked" due to local publication failure; failure only means that the affected scope continues to be isolated.
[0109] When there are many derived references and it is impossible to update them one by one within the same transaction, first write all the invalid and available reference indices under the unpublished new control version. Then, within the switching transaction, lock and verify the current version and control revision number of the plan, graph, decision, and target according to the aforementioned rules. After all matches, atomically switch the current control version pointer. Do not switch the pointer if the new version is not fully written, the process exits, or the version check fails. This method and the aforementioned transaction method are alternative implementations, both requiring that the gateway cannot read half of the new state and half of the old state.
[0110] Local commits do not include transactions executed by remote tools. The success of remote compensation is still verified by steps S102 to S104; this prevents remote concurrency from overriding remote condition operations that depend on step S106. When the gateway reissues, it reads the current control revision number and cannot bypass checks using old packets held by the model. Operations already in transit, even if subsequently affected by new isolation, can only be retroactively verified; they cannot be assumed to have not taken effect.
[0111] After release, re-check the termination conditions: Mark as successful completion if the target effect is met, dependencies are valid, and there are no pending isolation items affecting the target; mark as recovery complete if recovery processing is complete, there are no related unknown effects, and a safe state allowed by the contract is reached; mark as pending verification and retain the corresponding isolation if there are still unknown effects, version conflicts, known effects that cannot be safely processed, or the release is incomplete. An empty set of currently active unknown actions U is not a sufficient condition for success or recovery completion. When allowing independent branches to continue, their output must use a released state that has passed boundary verification.
[0112] See also Figure 1 The intelligent agent re-plans and generates new tool action proposals based on the published current control state, and the new tool action proposals proceed to step S101; for new tool action proposals that have not yet registered action identifiers, the execution gateway verifies them based on the remaining isolation range and the evidence references used. If the references invalid evidence or fall within the remaining isolation range, the proposals are rejected; if the target effect has been fully satisfied and there are no pending isolation items, no new tool action proposals are generated.
[0113] In one embodiment of the present invention, an agent execution verification and dependency subgraph recovery system is provided to address the uncertainty of the effective state of heterogeneous tools. This system is deployed between the agent and the heterogeneous tools. Figure 2 As shown, the system includes the following modules: An intelligent agent is configured to generate tool action proposals based on the received target task and to generate a task target record containing a task identifier and a target version. An execution gateway and persistent ledger are configured to read the tool effect contracts and tool action proposals of heterogeneous tools, and generate action records and effect item records. The execution gateway persists the action records, effect item records, and action dependency graph. After registration and verification, it sends a tool invocation request corresponding to the action record to the heterogeneous tool. If no final state acknowledgment is received for the tool invocation request, the effect item corresponding to the tool invocation request is set to "unknown effectiveness". Using the action to which the effect item with "unknown effectiveness" belongs as an uncertainty seed, the uncertainty is propagated along the dependency edges and constraint groups in the action dependency graph to determine the set of actions and resource scope that need to be isolated, thereby generating an isolation record. The isolation record is used by the execution gateway to prevent duplicate tool invocation requests for the same resource and the issuance of subsequent actions that depend on the execution result of the tool invocation request. It also generates a pending verification item containing the original operation identifier and contract version. The dynamic dependency graph manager is configured to generate an action dependency graph containing action nodes, dependency edges, and constraint groups based on the actual parameter references of the actions, resource access scope, and constraint groups. An evidence verifier is configured to verify the actual response execution result of the tool invocation request based on the original operation identifier and contract version in the item to be verified, rather than re-initiating the tool invocation request, and obtain a verification evidence record; based on the verification evidence record, determine each effect item as having occurred, definitely not having occurred, or unknown, and generate an effect determination record, which includes an overall status distinguishing between effective, ineffective, partially effective, and unknown effectiveness, as well as an action type distinguishing between business actions and compensation actions; and provide the effect determination record to the isolation and recovery controller. An isolation and recovery controller is configured to determine, based on the overall state in the effect judgment record for action types (business actions) and the task target record, the effect items to be revoked, retried under control, or supplemented, and their corresponding action instances, and propagate them in the action dependency graph to form a recovery set and a set to be retained; perform boundary verification on the recovery set and the set to be retained, generate a recovery plan containing processing type, version reference, and boundary verification results, and register the control revision number corresponding to the recovery plan; and execute the processing items corresponding to the recovery set according to the recovery plan based on the effect judgment record for action types (compensation actions), including: registering new attempts associated with the original processing items for processing items that need to be re-executed; performing conditional compensation and verifying the compensation effect for effective effect items that need to be revoked; if the compensation effect is unknown, re-execute steps S102 to S104; and summarizing the verification results of each processing item and the processing items that have not been verified to generate a recovery result record. The evidence invalidation and context revision module is configured to generate a continuing execution status package to be published based on the recovery result record and the set to be retained. This package includes a valid reference index generated from the verified valid outputs in the set to be retained; a list of invalid evidence located by the original verification evidence corresponding to the revoked effect item and the invalidation determination of the result; a range of invalid derived content determined layer by layer along the evidence reference relationship; a set of prohibited actions obtained by deduplicating the restricted actions in the isolation record, the incomplete items, and subsequent actions that still reference invalid evidence; and the remaining isolation range. In the same local commit, the module verifies the version reference and control revision number of the recovery plan. If all match, the continuing execution status package is published as the current control state used by the execution gateway. If publication fails, the original isolation is maintained. The execution gateway verifies the reference and issuance conditions of subsequent actions based on the published current control state.
[0114] The above core modules are in Figure 2 The process is only drawn once. The execution gateway provides the action record and contract version to the evidence verifier and executes the read-only query selected by the verifier. The responses from heterogeneous tools are archived by the gateway and then delivered to the verifier. The recovery controller delivers the isolation record and recovery plan to the same execution gateway, without setting up a separate compensation gateway with independent judgment authority. The compensation determination returns to the recovery controller to form the recovery result, which is then delivered to the context revision module to generate the state package to be published. The gateway completes the local publication according to step S107 and provides the published package to the agent. The same publication path is also used when there are no external compensation items.
[0115] The basic system comprises the tool effect contract library, execution gateway and persistent ledger, evidence verifier, dynamic dependency graph manager, isolation and recovery controller, and evidence invalidation and context revision module. Detailed explanations of each module are provided below: Regarding the tool effects contract library: The tool effect contract library stores tool effect contracts, which are machine-readable rule records registered according to tool and operation type. The access party configures the contract based on the interface documentation and verified service capabilities, assigning a contract identifier and version; support for idempotency, final state queries, or atomic compensation cannot be inferred solely from the tool's natural language description. Contract records include parameter patterns, resource key mappings, read / write fields, effect item templates, evidence extraction paths, success and non-occurrence judgment conditions, request termination conditions, visibility conditions, compensation rules, and cross-action constraint group templates. The execution gateway uses the parameter patterns and effect item templates to generate action records, the evidence verifier interprets the response using the same contract version, and the recovery controller uses compensation rules and constraint group templates to generate a recovery plan.
[0116] Resource keys consist of service namespace, tenant or isolation domain, object type, and object identifier; field paths are recorded separately. For example, the resource key "compute / tenant1 / reservation / GR-01" for the GPU reservation group, along with the fields "serverIds" and "state," respectively locate the server list and reservation status. Specific servers are registered with their respective device identifiers as resource keys. Before creation, when there is no reservation group or device identifier, the compute cluster and candidate device range, allocated slots, and operation identifier are registered; upon receiving a valid identifier, a mapping is established and a graph version is added. Conflict scope is narrowed only when the mapping basis is sufficient; dependencies cannot be eliminated based on name similarity.
[0117] Effect items are external changes that can be verified individually, not arbitrary text fragments (it is not assumed that all tools have the ability to query each item individually). They are split according to independent result fields or independent submission units of the contract: for operations reserving 3 GPU servers, if the interface can return the final state of each allocated slot separately, then effect items are created for each of the 3 slots and bound to the actual devices; if the interface only provides the overall atomic result, then an overall effect item is registered. Each item must have an expected change and a judgment rule. Expected changes are requirements before execution, not evidence of occurrence; unobservable items are explicitly marked as having no query capability and remain unknown or manually verified subsequently. Only pure read actions are allowed to have an empty set of external effect items; such actions register the read result and evidence version; write actions are rejected if no effect item definition is provided.
[0118] Regarding execution gateways and persistent ledgers: An action proposal includes a task identifier, step identifier, tool operation, parameters, parameter references, and preconditions. Parameter references indicate which preceding action output or evidence field a parameter is taken from. Natural language input can be converted into a proposal by the agent, but the gateway only accepts proposals that pass the contract field validation; if resource identity, effect definition, or required parameters are missing, a field error is returned, and no write operation is performed.
[0119] The gateway assigns logical action identifiers and attempt identifiers based on the proposal, references the specific contract version, and instantiates parameters into effect item records. Effect item records include the effect item identifier, the attempt it belongs to, the target resource scope, the expected change, the evidence reference, and the current effect status. Before execution, only the expected resource scope, expected change, and existing valid input evidence can be filled in. The actual object identifier, actual resource version, and final state evidence reference that have not yet been obtained remain to be bound; these are subsequently filled in by attributable receipts or query responses, and the source of the fields is recorded. The gateway simultaneously captures the actual input evidence version used and the available resource version, persisting the action record, effect item record, and dependency edges before issuing them. The ledger contains append-only event records and a current state table with revision numbers; recovery workers obtain update rights by comparing and exchanging state revision numbers.
[0120] The ledger stores remote operation identifiers, receipts, and distribution times. If a distribution intent is detected but no final status receipt is available, only a verification task is generated; it is not directly re-executed. Before the gateway distributes each subsequent or compensation request, it rereads the published current control state, the version of the recovery plan on which it is based, and the valid status of the parameters referenced; only after verification is the tool invoked. The cached state packet is merely a copy and cannot replace the current version check in the persistent ledger.
[0121] Isolation prevents ordinary business proposals and subsequent conflicts, but does not require the isolation to be lifted before an approved recovery process can be executed. For controlled retries, completions, or conditional compensations generated by S105, the gateway reads the recovery plan from the persistent ledger, verifying the process item identifier, operation type, associated action instance, target effect item (for pure reads, the read object), resource and field range, evidence reference, and preconditions; the request scope must not exceed the process item, and there must be no unverified write effects affecting the process item. Read-only verification is performed according to the contract query path and does not obtain business write permissions. The model itself declares that "recovery requests" cannot pass this check.
[0122] Registering a recovery attempt may increase graph nodes and graph versions. In this case, the association between the new attempt and the original processing item is first established. The recovery controller then re-verifies the boundaries, objectives, and evidence of the processing item on the updated graph, and records the latest graph version and control revision number upon which it is based. The old version prior to registration must not be carried over for distribution, nor can the re-verification be skipped simply by changing the version number. The gateway compares the referenced versions locally and registers the distribution intent, preventing concurrent distribution of the same processing item. Distribution stops when a new isolation event or evidence change causes a mismatch. Only the processing item is allowed to execute after verification; subsequent processes remain isolated. Recovery receipts still need to be verified by S102 to S104 and published by S107. Gateway control does not cover external operators bypassing the gateway; remote concurrency protection is handled separately by the conditional write interface.
[0123] Regarding evidence verification devices: The evidence verifier reads the remote operation identifier, effect item, and contract version from the action log, selects the query interface, extracts the response according to the field path in the contract, and generates a verification evidence record. This record includes the evidence identifier, the associated attempt, the effect item identifier, the resource key, the source interface, the source record identifier, the collection time, the source version or water level, the final state flag, the result value, and the validity check result. The source version is the version of the external resource or event sequence; the ledger evidence revision number is the version of the locally appended record, and the two must not be mixed.
[0124] The validity check verifies the following in sequence: whether the source is an interface permitted by the contract; whether the operation identifier matches this attempt, or whether the object is uniquely assigned by a reliable mapping; whether the resource and result fields cover the items to be judged; whether the response is compatible with the contract version; and whether the query meets the consistency and watermark requirements of the contract. The watermark refers to the position of the event or commit position declared by the server; if the server does not provide it, it is recorded as missing and is not replaced by the local reception time. The digest hash is only used for content comparison and cannot prove the authenticity of the source.
[0125] Based on the verified evidence, the verifier outputs one of "occurred," "definitely not occurred," or "unknown" for each effect, citing the evidence identifier and judgment rules used. "Determined not occurred" requires both evidence of non-occurrence and termination evidence preventing the subsequent effect of the attempt. "Occurred" requires completion evidence covering all committed changes; "accepted" or completion of only one indistinguishable sub-effect does not meet the completion condition. Conflicting or missing evidence outputs "unknown" and the reason for the missing evidence. All results are summarized into an effect judgment record according to step S104, recording the overall four states of the action, effect details, current effect validity, judgment version, and evidence references, for processing by the isolation and recovery controller.
[0126] About the dynamic dependency graph manager: The action dependency graph uses registered action instances as nodes, with node keys representing logical action identifiers and attempt identifiers, and associated effect records. Nodes are created first, followed by edges whose endpoints are all within the node set. Each edge records its predecessor, successor, dependency type, involved resource fields or evidence identifiers, generation basis, and graph version; references lacking predecessor records must be completed or rejected, and edges without a source cannot be created.
[0127] Output Consumption Edge: If the actual parameters of action B reference the output or evidence of action A, an edge is created from A to B, and the referenced field is recorded. Resource Read / Write Edge: Compare the resource keys and field ranges of a unified composition. If there is an intersection and at least one party writes, establish conflict dependencies from front to back according to the known execution order; if there is concurrency and the order is uncertain, record a bidirectional conservative conflict edge. Control Dependency Edge: If the release condition of B reads the effect judgment result of A, an edge is created from A to B, and the condition identifier is recorded; this identifier is assigned when registering the preconditions of the proposal in S101 and is used to check the specific judgment conditions. Plan dependencies for which subsequent results have not yet been generated can be registered as references to be resolved, and must be bound to valid output and version before actual distribution.
[0128] Cross-step integrity constraints are recorded using constraint groups, which include group identifiers, member nodes, common pause rules, allowed post-resumption state combinations, and verification evidence. Group members are instantiated based on the contract template and actual object relationships, and are not automatically grouped simply because they are in the same task. Constraints are bound to an item when they only involve a specific effect, to an edge when they involve a relationship between two actions, and to a constraint group when multiple actions are required to satisfy the constraint. For example, "training submission must simultaneously obtain valid reservations on 3 servers" requires the corresponding effect to be satisfied, but independent backup storage inspection is not included in the common success or failure constraint of the training branch. Unknown resource aliases are registered for conservative conflicts according to the set range.
[0129] The graph version is incremented by the graph manager when nodes, edges, or constraint groups change. Old edges retain their historical generation basis; when an effect is revoked, the relevant edges are marked as requiring review, preserving their propagation ability until the dependency result becomes invalid and the processing is completed. Edges cannot be deleted prematurely, as this could lead to the omission of subsequent successors. New valid outputs generate new edge records and graph versions after the reference to be resolved is bound to new evidence.
[0130] Regarding the Isolation and Recovery Controller: The controller reads the effect judgment record or the judgment record and action dependency graph to obtain the isolation set and output the isolation record; S105 also incorporates the recovery impact scope into the isolation before the recovery is issued. The isolation record includes the action set, resource scope, cause type and its effect item, reference to the judgment or recovery processing item, reference graph version, and release condition. During the unknown state, conflicting actions are suspended, and read-only verification is allowed; actions already in progress are registered as pending verification and cannot be assumed to have been canceled.
[0131] Once the verification yields a decisionable result, the controller calculates the recovery set and the proposed retention set based on the task objective record and constraint group, outputs a recovery plan, and records the latest control revision number after isolation and persistence before recovery. The plan record includes the plan version, graph version, decision version, target version, control revision number read during creation, recovery set, proposed retention set, node-by-node processing type, boundary verification results, and compensation order. K represents the set of actions to be retained that passed boundary verification during the planning phase; only after the corresponding state is successfully published can its valid output continue to be used according to the new state. The boundary verification results list the dependent prerequisites, fields that will change during recovery, comparison evidence, and reasons for success or failure; see step S105 for specific calculations. Any version change must be re-verified before further distribution.
[0132] Compensation requiring modification of shared resources must be checked and modified by the tool within the same atomic operation; a local read-then-write approach does not constitute this guarantee. The controller generates a recovery result record from the verified compensation effect, listing completed processing, still isolated items, revoked effect items, and their original evidence identifiers, for use by the context revision module.
[0133] Regarding the Evidence Expiration and Context Revision module: The derived summary, inference results, and subsequent parameters each store the cited evidence identifiers and revision numbers. This module reads the recovery result record, retrieves the original verification evidence from the revoked effect item or invalidation, and generates a pending invalidation marker; it then determines the scope of pending invalidation of the derived content layer by layer along the evidence citation relationship until no more new objects are added. This scope is written into the release package or new control version not yet released in step S107, and the official usability status is updated uniformly upon release. The original evidence is retained for auditing purposes; invalidation indicates that the current execution premise is no longer supported, but historical facts are not deleted.
[0134] The valid reference index is generated from valid output references in the proposed retention set and verified new output references. Index entries are associated with evidence identifiers, revision numbers, associated actions, and available fields; references to be invalidated are not included in the new index. The prohibited action set is obtained by summarizing and deduplicating restricted actions in isolation records, incomplete items in recovery results, and subsequent actions that still reference invalid evidence. When a new proposal does not yet have an action identifier, the gateway still verifies it based on the scope of the isolated resource and the evidence references used; it cannot allow it simply because it is not in the existing action set.
[0135] This module uses the aforementioned valid reference index, prohibited action set, and still isolated items to generate a pending execution status package. This package includes valid output references, a list of invalidation evidence, the scope of resources to be isolated, the prohibited action set, the task target version, the current plan version, and the control revision number read during creation. After this package is verified and published in step S107, the agent replans accordingly, and the execution gateway rejects expired references based on the published status. If the model proposes the same literal parameters but cannot provide the valid source references necessary for the controlled resources, it will still refuse to publish; the verification cannot be bypassed by removing the reference field.
[0136] In one embodiment of the present invention, the control revision number is the version identifier of the current control state in the local persistent ledger of the execution gateway and the persistent ledger, which increments as the isolation scope increases or the continued execution state package is successfully published; Before issuing a recovery, the isolation and recovery controller incorporates the impact scope of the processed item into the isolation record and persists it through the persistent ledger. If there are new isolation scopes, the control revision number is incremented. If the existing isolation covers the entire scope, the current control revision number is reused. The recovery plan saves the control revision number after isolation registration. If new verification data, action dependency graphs, or changes in task target records occur after registration, the recovery plan is re-verified. The continued execution status packet generated by the evidence invalidation and context revision module carries the control revision number read at creation time; in the same local commit, if the control revision number read at creation time is consistent with the current control revision number, the commit is published and the control revision number is incremented; if they are inconsistent, the commit is rejected, the original isolation is maintained, and the continued execution status packet is recalculated.
[0137] It should be noted that the intelligent agent execution verification and dependency subgraph recovery system for uncertain effective states of heterogeneous tools provided by this invention and the above-mentioned intelligent agent execution verification and dependency subgraph recovery method for uncertain effective states of heterogeneous tools belong to the same inventive concept. The system embodiment lists the execution subject and its specific characteristics of each step of the method embodiment, and the method embodiment lists the information flow between the execution subjects in the system embodiment. Here, all the contents of the method embodiment are incorporated into the system embodiment by mutual reference, and all the contents of the system embodiment are incorporated into the method embodiment.
[0138] First specific implementation: The training job is canceled after the GPU reserved receipt is lost.
[0139] Taking task T1, which "reserves 3 GPU servers in computing cluster CL-G01 that meet the configuration requirements listed in the task for training job JOB-01, submits the training to the scheduler after obtaining valid reservation credentials, and simultaneously reads the device status of independent backup storage cluster BK-01 to generate a local inspection summary," as an example, the three actions are the reservation action (denoted as A1), the training submission action that has not yet been issued (denoted as A2), and the independent inspection reading action (denoted as A3). The identifiers, versions, and counts in this example are design timing examples and not actual test records. Reservation sets the allocable status of a specific device to be occupied by this job, but does not mean that the training process has started.
[0140] Step S101 registers operation OP-01 according to the resource contract, attempts A1-1 and the effect items A1-E1 to A1-E3 of the three allocation slots; the device list and reserved certificate parameters of A2 await the output of A1. The first version of the action dependency graph G is obtained, showing an output consumption dependency from A1 to A2. A3 only accesses the independent backup storage cluster BK-01, obtaining inspection evidence EV-03 and a valid read determination. After the resource system executes A1, the network is interrupted during the return of the receipt; S102 registers U={A1}, the current action set that needs to be isolated Q={A1, A2}, changes the control revision number from 6 to 7, and prevents replay of reservations and submission of training.
[0141] S103 queries according to OP-01: Evidence EV-01, currently "processing," is obtained for the first time. S104 generates an unknown determination J-01. EV-02 is obtained again, confirming that the reserved group GR-01 of JOB-01 contains devices GPU-S01, GPU-S02, and GPU-S03, each corresponding to one of the three allocated slots, with a status of "reserved," a reservation certificate of RC-01, and a reserved group version of 8. S104 matches the ownership and completion conditions item by item, generating an effective determination J-02. After the graph manager binds to the real device, GR is updated to version 2. A change in the number of idle devices alone does not constitute the aforementioned ownership proof.
[0142] Before training submission A2 is issued, the task interface receives and confirms cancellation event CE-01, updating JOB-01 target from version 1 to version 2: "Cancel training, release unconsumed reservations, and prohibit submissions." S105 reads J-02 and target version 2, generating R={A1, A2} and K={A3}: A1 corresponds to releasing GR-01, A2 corresponds to discarding the training proposal, and A3 corresponds to retaining the inspection summary. Plan P version 1 references diagram version 2, current judgment, and control revision number 7; the original isolation has been covered by the restoration scope. The target change does not change the historically effective judgment of A1 to ineffective.
[0143] S106 registers the stable compensation identifier CP-01 and a new compensation attempt for the release processing item. After the graph is updated, the dependency boundaries, evidence, and objectives are re-verified according to 3.3.2, and the plan version is updated. The resource system checks the ownership of GR-01 to JOB-01, the reserved group version 8, and the unconsumed status in the same conditional operation according to the contract in this example, and then releases its equipment occupation. Evidence EV-04 is queried to prove that GR-01 has been released and the group version is 9. S104 sends back the compensation judgment JC-01. The controller re-verifies the current graph, judgment, and objectives, updates the plan version, and generates the recovery result RR-01, associating the CP-01 completion evidence, A2 discard result, and A3 retention result.
[0144] S107, based on RR-01, includes reserved fields in RC-01 and EV-02 that serve as prerequisites for current execution, as well as training parameters and derived summaries referencing these fields, in the invalidation scope, while retaining the historical facts of EV-02 and the release facts of EV-04. EV-03 and A3 inspection summaries remain valid outputs; completed processing items with release justification no longer form candidate Q seeds. After completing the same submission verification according to the current plan, graph, decision, target, and control revision number, the control revision number is updated from 7 to 8, and a new status is published. The final recovery end status is "training not submitted, reserved fields released, inspection results retained," without marking training as successful. Local release failures continue to be isolated, and old credentials are not prematurely released simply because the server has been released.
[0145] If the second query still cannot prove the reserved result, it remains unknown and isolated; the cancellation event cannot be considered as proof of non-execution. If there is no cancellation event and the target is still valid, the reserved result is verified in S105 and a reserved result is formed. After the valid reference of RC-01 is successfully published in S107, A2 can use the credential to submit training. Successful submission only proves that the scheduling system has received or created the corresponding job; whether the completion conditions specified in the task have been met still needs to be verified according to the scheduling tool contract.
[0146] Second specific embodiment: GPU server part reserved and recovery scope.
[0147] In another training job, JOB-02, action B1 also requests the allocation of slots to three GPU servers; B2 is a training submission that has not yet been issued, and B3 is an independent backup storage inspection. The resource contract requires that all three slots have valid reservations before the training submission and that the final state of each slot can be reported separately. Evidence EV-21 proves that the first two slots have been allocated to GPU-S11 and GPU-S12 respectively, belonging to reservation group GR-02; EV-22 proves that the third slot terminated due to the lack of available devices and no resources were allocated. S104 generates a partial validity determination; two allocated slots cannot be considered as a complete success, nor can the complete reservation request for all three GPUs be replayed.
[0148] If the JOB-02 objective remains valid, S105 includes B1 and B2, which depends on its result, in the recovery scope; only a completion processing item is generated for the third slot, using valid reserved evidence from the first two slots and finalized evidence from the third slot as input. According to the contract, the validity of the first two reservations is first verified, and then a new attempt is created for the missing slot. After completion verification, the new evidence is mapped to the original planned completion conditions for the third slot, without rewriting the historical validity of the original attempt; B2 is only allowed to submit for training after all three slots meet the requirements and a valid reference is published. If the completion is unknown, isolation continues, and the two already successful slots are not re-applied for.
[0149] If a valid cancellation event from JOB-02 is received, S105 forms R={B1, B2} and K={B3}, listing the actually allocated reserved slots for GPU-S11 and GPU-S12 as release items. The third slot does not need to be released since it is determined that no cancellation has occurred, and B2 discards the proposal. Before release, GR-02 and its conflicting dependencies are isolated. S106 releases the slots based on the real reserved group identifier in EV-21 and the current version execution conditions, and verifies that both effects that have occurred have been revoked. S107 invalidates the old reserved certificate and B2 parameter references accordingly, retains the valid inspection output of B3, and marks the end of recovery only after publication.
[0150] If there are other registered device configuration actions whose results are only valid while the reservation exists, the dependent edge or constraint group shall include the configuration action in the scope of review; the corresponding processing item shall only be added if the contract explicitly provides a safe recovery operation and the verification conditions are met. Independent inspections cannot be cancelled just because B3 belongs to the same agent task, nor can it be assumed that running training or device configuration can be directly rolled back without specifying the interface capabilities.
[0151] Third specific implementation: Reserved version conflict and loss of release receipt.
[0152] The controller is preparing to release the three servers of JOB-01 according to version 8 of GR-01, but the reserved group in the resource system has been updated to version 9 by other legitimate operations. The conditional release interface refuses to modify due to version mismatch, and the controller re-verifies according to the original reserved identifier, and cannot forcibly write back the device allocation status from version 8.
[0153] If current evidence indicates that the reservation has been legally consumed by another entity and there is no contractually permissible safe release method, then the reservation and related submission requests are kept isolated, and pending verification items are output; training is not inferred to have stopped. If the conditional release is actually successful but the receipt is lost, then the release final state is queried according to CP-01; if the final state is unknown, verification continues, non-idempotent release requests are not submitted repeatedly, and old reservation credentials are not prematurely made available again.
[0154] Fourth specific implementation: Restarting the recovery process and controlling old reserved credentials.
[0155] If A1 has already been reserved in the resource system, but the gateway exits before the persistent receipt is received, the newly recovered worker can locate the call through the unterminated intent of OP-01, obtain the right to update the action status, and then query the original operation. The expiration of the worker's lease does not mean that the server reservation was invalid, and the same three servers cannot be re-applied for.
[0156] If GR-01 has been released and EV-04 and the compensation decision have been persisted, but the gateway exits before publishing the invalidation state of RC-01 and derived training parameters, it will still use the isolation state before exiting after restarting. The recovery worker reads the verified release result, reconstructs the release package, and no longer issues CP-01. After S107 verification and successful publication, even if the model submits an old training request containing RC-01 again, the gateway will refuse to issue it based on the current target and invalid reference. If preparing a new training job, a valid target and server reservation should be obtained again; credentials for canceled jobs should not be reused.
[0157] If a new isolation event occurs before release, causing a change in the control revision number, the old package commit will fail and be recalculated. Even if the control revision number remains unchanged, if the target version changes after pre-check, the commit transaction will still refuse to release due to the referenced version mismatch; the committable state under the old target will not be overwritten on the current canceled target.
[0158] The above four specific embodiments all conform to the following prototype data structure and interface conventions: The minimum implementation uses an action table, effect table, evidence table, dependency table, constraint group table, recovery plan table, task goal table, and control state table. The action table uniquely identifies instances using the task, logical action, and attempt identifier, while also restricting concurrent issuance of the same logical action. The effect table uniquely identifies actions using both the action instance and the effect item identifier. Actions are written to the action table or its associated effect judgment table, storing the overall four-state state. The effect table stores the individual three-state state; partial effects cannot be simultaneously treated as indivisible individual states and overall states.
[0159] Pure read actions also save read judgment records, associate them with action instances, read status and return evidence, and do not forge write effect judgments in empty effect item tables.
[0160] The Evidence Table stores the source interface, source record, actual resource version, and local evidence revision number; the Effect Item Table references evidence but does not treat expected values as actual values. The Recovery Plan Table stores P, graph version, decision version, target version, R, K, and processing items; where R and K are action instance sets, processing items reference specific effect items, and pure read processing items reference the read object and field range. The Control Status Table stores the control revision number, current isolation range, valid reference index, and prohibited action set; after a successful S107 commit, it becomes the official status read by the gateway.
[0161] The tool adapter provides three interfaces: execution, query results, and conditional compensation. Query results must not be written to business logic; conditional compensation receipts provide an operation identifier, result fields, and response information such as completed, version conflict, or being processed. Transmission errors are recorded by the gateway as a lack of reliable receipts; the tool cannot always return "unknown." Responses are only considered for effect determination after S104 verification; unsupported interface capabilities must be explicitly declared.
[0162] Event consumption uses the source interface, action instance, and event number for deduplication. When the server lacks a monotonic event sequence number, late messages are only used as candidate evidence for re-verification and do not overwrite already verified states in the order of arrival. Local control revision numbers are used to compare and exchange control states; remote resource versions only perform conditional operations on the same resource, and the two are not compared for numerical equality.
[0163] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0164] The above description is only a specific embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An agent execution verification and dependency subgraph recovery method for heterogeneous tool validation state uncertainty, deployed between an agent and a heterogeneous tool, characterized in that, Includes the following steps: S101. The agent generates a tool action proposal based on the received target task and generates a task target record containing the task identifier and target version. The execution gateway reads the tool effect contract and the tool action proposal of the heterogeneous tool, and generates action records and effect item records; the dynamic dependency graph manager generates an action dependency graph based on the actual parameter references, resource access scope and constraint groups of the action; The execution gateway persists the action record, effect item record, and action dependency graph. After registration and verification, it sends a tool call request corresponding to the action record to the heterogeneous tool. S102. If no final status receipt is received for the tool call request, the effect item corresponding to the tool call request is set to unknown effectiveness. Using the action to which the effect item with unknown effect belongs as the uncertainty seed, propagate along the dependency edges and constraint groups in the action dependency graph to determine the set of actions and resource scope that need to be isolated, and then generate an isolation record. The isolation record is used by the execution gateway to prevent repeated tool call requests for the same resource and the issuance of subsequent actions that depend on the execution result of the tool call request; and to generate a verification item containing the original operation identifier and contract version. S103. The evidence verifier verifies the actual response execution result of the tool call request based on the original operation identifier and contract version in the item to be verified, rather than re-initiating the tool call request, and obtains the verification evidence record. S104. Based on the verification data record, determine each effect item as having occurred, not having occurred, or unknown, and generate an effect determination record, which includes the overall status of being effective, not effective, partially effective, and unknown in effect, as well as the action type of business action and compensation action; provide the effect determination record of action type business action to step S105, and provide the effect determination record of action type compensation action to step S106. S105. Based on the overall status in the effect judgment record of the action type being business action and the task target record, determine the effect items that need to be canceled, retried under control, or supplemented, and their corresponding action instances, and propagate them in the action dependency graph to form a recovery set and a set to be retained; perform boundary verification on the recovery set and the set to be retained, generate a recovery plan containing processing type, version reference, and boundary verification results, and register the control revision number corresponding to the recovery plan; S106. Based on the effect determination record of the action type being a compensation action, execute the processing items corresponding to the recovery set according to the recovery plan, including: for processing items that need to be re-executed, register new attempts associated with the original processing items; for effective effect items that need to be revoked, perform conditional compensation and verify the compensation effect; if the compensation effect is unknown, re-execute steps S102 to S104; summarize the verification results of each processing item and the processing items that have not been verified to generate a recovery result record; S107. Based on the recovery result record and the set to be retained, generate a continued execution status package to be published; in the same local commit, verify the version reference and control revision number of the recovery plan, and publish the continued execution status package as the current control state used by the execution gateway after all matches are found. If the publication fails, maintain the original isolation; the execution gateway verifies the reference and issuance conditions of subsequent actions based on the published current control state to realize the closed loop of execution verification, dependency subgraph recovery and continued execution control.
2. The agent execution verification and dependency subgraph recovery method for heterogeneous tool effectuation state uncertainty of claim 1, wherein, Step S105, which involves propagating the recovery set and the intended retention set in the action dependency graph, includes: For effect items whose overall status is "already in effect" and whose task objective records require the retention of the corresponding effects, their corresponding action instances are included in the set to be retained. For effect items whose overall status is "effective" and whose corresponding effects have been canceled in the task objective record, generate a processing item with the processing type "conditional compensation". For write actions whose overall status is ineffective and whose task objective requires the corresponding effect, generate a processing item with the processing type of controlled retry; For effect items whose overall status is inactive and whose corresponding effects have been canceled in the task objective record, discard action proposals that have not yet been issued; For actions that are partially effective in the overall state, only the effects that have not yet occurred are processed with a single-item completion type, and the effects that have occurred and their verification evidence records are retained; For actions whose overall status is unknown, continue to remain isolated and do not enter the recovery set; The action instance corresponding to the generated processing item is used as a seed and propagated along the action dependency graph to form the recovery set.
3. The agent execution verification and dependency subgraph recovery method for heterogeneous tool effectuation state uncertainty of claim 1, wherein, Step S104 also includes generating a read determination record for a pure read action without external write effect, which includes a read status that distinguishes between valid result, invalid result, and read status pending verification. Step S105 further generates failure handling or re-reading processing items for read judgment records with invalid read status, determines the action instance to which the read judgment record belongs, and propagates along the action dependency graph with the action instance as a seed to be included in the recovery set; for read judgment records with valid read status, the action instance to which it belongs participates in the retention verification of the proposed retention set. If the verification passes, it is included in the proposed retention set; if the verification fails, it continues to be isolated; for read judgment records with pending verification status, verification data records continue to be obtained. If the verification data records are still insufficient, the action instance to which the read judgment record belongs continues to be isolated.
4. The agent execution verification and dependency subgraph recovery method for heterogeneous tool effectuation state uncertainty of claim 1, wherein, Step S105 involves performing boundary verification on the recovery set and the proposed retention set, which includes: comparing the resource change range of each processing item in the recovery set with the input evidence, control premises, resource version and constraint group of the action in the proposed retention set, and performing boundary verification item by item. If the resource change range does not intersect with the dependency range of the action in the proposed retention set and the constraint group allows it to exist independently, then the boundary verification is passed. Completed consumption actions that fail boundary verification are added to the recovery set, while completed consumption actions that cannot be determined by boundary verification remain isolated.
5. The agent execution verification and dependency subgraph recovery method for heterogeneous tool effectuation state uncertainty of claim 4, wherein, Item-by-item boundary verification also includes: If the resource change range of the processing item in the recovery set intersects with the dependency range of the action in the intended retention set, then the dependency predicate of the action in the intended retention set is still valid after the processing item is executed, based on the tool effect contract. If there is current evidence to support the judgment, the boundary verification passes; if there is no current evidence to support the judgment, the boundary verification fails.
6. The method for agent execution verification and dependency subgraph recovery for uncertain effective states of heterogeneous tools according to claim 1, characterized in that, In step S104, the determination method for the effect item is as follows: If there is evidence of completion covering all promised changes for that effect, then that effect is considered to have occurred. If there is both evidence that the event did not occur and grounds for termination of the request to prevent the subsequent effect from taking effect, then the effect item is determined to have not occurred. If there is evidence that no action has occurred but no grounds to prevent the attempt to take effect from terminating the request, then the effect item is determined to be unknown; If there is conflicting or missing evidence, the effect item is determined to be unknown.
7. The method for agent execution verification and dependency subgraph recovery for uncertain effective states of heterogeneous tools according to claim 6, characterized in that, In step S104, the overall state is determined in the following way: The overall state is determined according to the following rules, using the set of necessary effect items determined based on the tool effect contract at the time of action registration as the summary scope: If all the effects in the set of required effects are determined to have occurred, then the overall status is "effective". If all effect items in the set of required effect items are determined to have not occurred, the overall status is ineffective. If at least one effect in the set of required effect items is determined to have occurred, at least one effect item is determined to have not occurred, and no effect item is determined to be unknown, then the overall state is partially effective. If any effect item in the set of required effect items is determined to be unknown, the overall state is "unknown". For the overall state where the effect is unknown, retain the individual judgment details of all effect items, where effect items that have been judged to have occurred will not be downgraded to unknown due to the lack of request termination basis.
8. The method for agent execution verification and dependency subgraph recovery for uncertain effective states of heterogeneous tools according to claim 1, characterized in that, The action type of the effect determination record in step S104 is inherited from the action type determined when the corresponding action record is registered: the action record registered by the execution gateway according to the tool action proposal has an action type of business action; the new action record registered by the execution gateway for the processing item in the recovery plan as associated with the original action and its effect item has an action type of compensation action. Step S104 provides the effect judgment record of the action type as a business action to step S105, and step S105 determines the processing type based on the overall status and the task target record; the effect judgment record of the action type as a compensation action is provided to step S106, and step S106 refers to the original recovery plan and processing item identifier to confirm or continue to verify the original processing item, and does not treat the compensation action as a processing item for generating reverse compensation for business failure.
9. The method for agent execution verification and dependency subgraph recovery for uncertain effective states of heterogeneous tools according to claim 1, characterized in that, The control revision number is the version identifier of the current control state in the execution gateway's local persistent ledger, and it increments as the isolation scope increases or the continued execution state package is successfully published. Step S105: Before the recovery is issued, the scope of impact of the processing item is incorporated into the isolation record and persisted. If there are new isolation scopes, the control revision number is incremented. If the existing isolation covers the entire scope, the current control revision number is reused. The recovery plan saves the control revision number after isolation registration. If new verification data, action dependency graphs or task target records change after registration, the recovery plan is re-verified. The continuation status packet in step S107 carries the control revision number read at creation time. If the control revision number read at creation time is consistent with the current control revision number in the same local commit, the commit is made and the control revision number is incremented. If they are inconsistent, the commit is rejected, the original isolation is maintained, and the continuation status packet is recalculated.
10. The method for agent execution verification and dependency subgraph recovery for uncertain effective states of heterogeneous tools according to claim 3, characterized in that, Step S107 generates the continued execution status package to be published, including: The evidence invalidation and context revision module reads the recovery result record, locates the corresponding original core verification evidence from the revoked effect item and the read judgment record with the read status being invalid, generates a pending invalidation mark, generates an invalid evidence list from the pending invalidation mark, and determines the invalidation scope of the derived content layer by layer along the evidence citation relationship until there are no more new derived objects. A valid reference index is generated from the verified valid outputs in the set to be retained. The index entries of the valid reference index are associated with evidence identifiers, actions, and available fields. References to be invalidated are not included in the valid reference index. The prohibited action set is obtained by summarizing and deduplicating the restricted actions in the isolation record, the unverified completed processing items in the recovery result record, and the subsequent actions that still cite invalid evidence; The pending execution status package is generated from the valid reference index, the list of invalid evidence, the remaining isolation range, the set of prohibited actions, the current target version of the task target record, the current plan version of the recovery plan, and the control revision number read at creation. During the generation process, the current control state of the execution gateway and its control revision number remain unchanged.
11. The method for agent execution verification and dependency subgraph recovery for uncertain effective states of heterogeneous tools according to claim 10, characterized in that, After the continued execution status package is successfully published as described in step S107, the following steps are also included: The execution gateway verifies subsequent actions based on the published current control state: it rejects the issuance of tool action proposals that reference credentials or parameters in the invalid evidence list; and it allows the issuance of subsequent actions that use valid outputs in the valid reference index, provided that the current task target record still requires the corresponding effect and the premise for using the valid output has not been revoked. After publishing the continued execution status package, check the termination conditions again: if the target effect is met, the dependencies are valid and there are no pending isolation items affecting the target, mark it as successfully completed; if the recovery process is completed, there are no related unknown effects and the safe state allowed by the tool effect contract is reached, mark the recovery as completed; if there are still unknown effects, version conflicts, known effects that cannot be safely processed, or the release is not completed, mark it as pending verification and retain the corresponding isolation.
12. The method for agent execution verification and dependency subgraph recovery for uncertain effective states of heterogeneous tools according to claim 11, characterized in that, The agent replans and generates new tool action proposals based on the published current control state, and the new tool action proposals proceed to step S101; for new tool action proposals that have not yet registered action identifiers, the execution gateway verifies them based on the remaining isolation range and the evidence references used. If the references are invalid evidence or fall within the remaining isolation range, the proposals are rejected; if the target effect has been fully satisfied and there are no pending isolation items, no new tool action proposals are generated.
13. A system for agent execution verification and dependency subgraph recovery addressing the uncertainty of the effective state of heterogeneous tools, deployed between agents and heterogeneous tools, characterized in that... Includes the following modules: An intelligent agent is configured to generate tool action proposals based on the received target task and to generate a task target record containing a task identifier and a target version. The execution gateway and persistent ledger are configured to read the tool effect contracts and tool action proposals of heterogeneous tools, and generate action records and effect item records. The execution gateway persists the action record, effect item record, and action dependency graph. After registration and verification, it sends a tool call request corresponding to the action record to the heterogeneous tool. And if no final status receipt is received for the tool call request, the effect item corresponding to the tool call request is set to unknown effectiveness; Using the action to which the effect item with unknown effect belongs as the uncertainty seed, propagate along the dependency edges and constraint groups in the action dependency graph to determine the set of actions and resource scope that need to be isolated, and then generate an isolation record. The isolation record is used by the execution gateway to prevent repeated tool call requests for the same resource and the issuance of subsequent actions that depend on the execution result of the tool call request; and to generate a verification item containing the original operation identifier and contract version. The dynamic dependency graph manager is configured to generate an action dependency graph based on the actual parameter references of the actions, resource access scopes, and constraint groups. An evidence verifier is configured to verify the actual response execution result of the tool invocation request based on the original operation identifier and contract version in the item to be verified, rather than re-initiating the tool invocation request, and obtain a verification evidence record; based on the verification evidence record, determine each effect item as having occurred, definitely not having occurred, or unknown, and generate an effect determination record, which includes an overall status distinguishing between effective, ineffective, partially effective, and unknown effectiveness, as well as an action type distinguishing between business actions and compensation actions; and provide the effect determination record to the isolation and recovery controller. The isolation and recovery controller is configured to determine the effect items that need to be undone, retried under control, or supplemented, and their corresponding action instances, based on the overall state in the effect judgment record of the action type being a business action and the task target record, and propagate them in the action dependency graph to form a recovery set and a set to be retained; perform boundary verification on the recovery set and the set to be retained, generate a recovery plan containing the processing type, version reference, and boundary verification results, and register the control revision number corresponding to the recovery plan; And based on the effect determination record of the action type being a compensation action, execute the processing items corresponding to the recovery set according to the recovery plan, including: for processing items that need to be re-executed, register new attempts associated with the original processing items; for effective effect items that need to be revoked, perform condition compensation and verify the compensation effect; if the compensation effect is unknown, re-execute steps S102 to S104; summarize the verification results of each processing item and the processing items that have not been verified to generate a recovery result record; The evidence invalidation and context revision module is configured to generate a continued execution status package to be published based on the recovery result record and the set to be retained; in the same local commit, it reviews the version reference and control revision number of the recovery plan, and publishes the continued execution status package as the current control state used by the execution gateway after all matches are found, and maintains the original isolation if the publication fails; the execution gateway verifies the reference and issuance conditions of subsequent actions based on the published current control state.
14. The agent execution verification and dependency subgraph recovery system for uncertain effective states of heterogeneous tools according to claim 13, characterized in that, The control revision number is the version identifier of the current control state in the local persistent ledger of the execution gateway and the persistent ledger, and it increments as the isolation scope increases or the continued execution state package is successfully published; Before issuing a recovery, the isolation and recovery controller incorporates the impact scope of the processed item into the isolation record and persists it through the persistent ledger. If there are new isolation scopes, the control revision number is incremented. If the existing isolation covers the entire scope, the current control revision number is reused. The recovery plan saves the control revision number after isolation registration. If new verification data, action dependency graphs, or changes in task target records occur after registration, the recovery plan is re-verified. The continued execution status packet generated by the evidence invalidation and context revision module carries the control revision number read at creation time; in the same local commit, if the control revision number read at creation time is consistent with the current control revision number, the commit is published and the control revision number is incremented; if they are inconsistent, the commit is rejected, the original isolation is maintained, and the continued execution status packet is recalculated.
