An agent skill instruction syntax ambiguity behavior influence detection method and system

By repeatedly running different syntactic interpretation versions of agent skill instructions in a virtual software space, a shared resource set is constructed and operation sequences are recorded, solving the problem of detecting the impact of syntactic ambiguity in agent skill instructions and achieving efficient and low-cost detection results.

CN123178241APending Publication Date: 2026-11-27SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611695801.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies struggle to detect the impact of syntactic ambiguity in agent skill instructions on behavior under consistent execution conditions, and testing costs are high, making it difficult to distinguish between operational fluctuations and interpretation differences.

Method used

Different syntactic interpretation versions of agent skill instructions are repeatedly run in a virtual software space. By constructing a shared resource set and local disambiguation rewriting, the operation sequence is recorded and the separation interval is calculated, and the strictly separated detection results are output.

Benefits of technology

It reduces the test's reliance on the real system, minimizes interference from irrelevant resources, can identify behavioral differences that only occur in a certain interpretation direction, and limits the interference of changes through non-target text consistency checks, providing consistent comparison conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178241A_ABST
    Figure CN123178241A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of software testing and artificial intelligence, and discloses an agent skill instruction syntax ambiguity behavior influence detection method and system. The method identifies the target sentences of two reasonable syntax interpretations in the skill instruction, structures the interpretations and identifies the operation differences, and accordingly constructs a shared resource set and a task, a context and an allowed operation; the original version is reserved and two local disambiguation versions are generated; the three versions are repeatedly run in a virtual software space, only the operation requests are recorded without executing real actions; the operation names are extracted according to the calling sequence and the repeated calls are reserved to form an operation sequence; the separation interval is obtained by subtracting the maximum distance in the version from the minimum distance between the versions, and the strict separation result is output when at least one separation interval is greater than zero. The application does not need to preset the correct calling chain, reduces the real environment deployment dependence, and outputs the traceable tool selection, calling number and sequence difference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of software testing and artificial intelligence technology, and specifically relates to a method and system for detecting the impact of syntactic ambiguity in intelligent agent skill instructions. Background Technology

[0002] Agent skills organize reusable task knowledge into loadable instruction packages, typically describing task processing methods through skill description files, and may include references, scripts, and other resources. This specification refers to the natural language instructions used to guide agent operations within the skill package as skill instructions. The agent combines skill instructions, user tasks, available tool interfaces, and interaction history to select tools and parameters, and utilizes information returned by the tools to continue making operational decisions.

[0003] The same natural language instruction may have two reasonable interpretations depending on the position of modifiers, phrase combinations, scope of parallelism, restoration of omitted components, or different subject structures. Existing text analysis can identify such syntactic ambiguities and provide explanations, but the explanations alone cannot indicate whether the agent will choose different operations during execution.

[0004] For example, the approval condition in the instruction "Review and publish the report if approved." can constrain both the review and publication actions, or only the publication action. If the test only provides an approved report, both interpretations require review and publication; only under specific conditions, such as an unapproved report, do the two interpretations differ in their requirements regarding review. Therefore, ordinary task input may mask the operational differences between syntactic interpretations.

[0005] Testing directly in a real software environment requires configuration files, permissions, service status, and tool responses. A single tool call may alter the state read by subsequent calls, and it may be difficult to fully restore external conditions between different runs. If only the results obtained from different runs are compared, environmental changes may be mixed with the effects of command interpretation; deploying and restoring the environment task by task further increases testing costs.

[0006] Even with identical tasks, skill instructions, and initial environments, large language model agents may repeatedly read, change the order of calls, or select different tools. Simply comparing a single execution of the original text and the disambiguated text cannot distinguish the behavioral changes accompanying such operational fluctuations and interpretation differences. Therefore, it is necessary to transform interpretation differences into test resources, collect tool call chains under consistent execution conditions, and use the operational fluctuations of the same version itself as a reference to determine differences between versions.

[0007] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0008] To address or at least mitigate one or more of the above problems, a method and system for detecting the impact of syntactic ambiguity in agent skill instructions is provided. This method can transform operational differences between syntactic interpretations into shared test resources, execute three versions of skill instructions in a controlled manner in a consistent virtual software space, and judge the differences in call chains between versions by using the operational fluctuations of the same version itself as a reference. Thus, the sensitivity of agent behavior to the syntactic interpretation of skill instructions can be detected without pre-setting a correct interpretation or a correct call chain.

[0009] To achieve the above objectives, according to a first aspect of the present invention, a method for detecting the impact of syntactic ambiguity in intelligent agent skill instructions is provided, comprising the following steps:

[0010] S1. Obtain the skill instructions of the agent to be detected, identify the target sentence with two reasonable syntactic interpretations, structure the two interpretations and identify their operational differences, and construct a shared resource set, task, text context and allowed operations accordingly.

[0011] S2. Retain the original version of the agent's skill instructions, fix the first and second interpretations of each target sentence, and perform local disambiguation rewriting on each target sentence to obtain the first and second disambiguation versions, while keeping the non-target text unchanged.

[0012] S3. Construct a virtual software space based on a shared resource set, including resource snapshots, read interfaces, action interfaces, and request dispatchers. This allows agents to repeatedly run in the virtual software space under the same task, text context, allowed operations, tool response rules, and agent configuration, in the original version, the first disambiguation version, and the second disambiguation version. Before each run, the resource snapshot, interaction history, and operation request records are reset. The read interface returns the preset resource facts, and the action interface verifies and records the operation requests without executing real system actions.

[0013] S4. Extract the operation names from the records of each valid run in the order of call and retain duplicate calls to form the operation sequence of each version;

[0014] S5. For the control consisting of the original version and each disambiguation version, if each version of the control has at least two valid runs, the separation interval is obtained by subtracting the maximum distance between different run operation sequences within each of the two versions of the control from the minimum distance between the operation sequences of different versions; when at least one separation interval is greater than zero, the detection result of strict separation and the corresponding operation sequence and separation interval are output.

[0015] Furthermore, the identification of target sentences with two reasonable syntactic interpretations includes: extracting instruction units with operational meaning according to the order of the source text, saving the original text, position, and occurrence number; combining the instruction units and their context to detect ambiguity in modification attachment, phrase combination, parallel structure, ellipsis, and new subject structure; retaining two interpretations with different syntactic structures for the same original text that are reasonable in both grammar and context, excluding differences caused solely by word meaning, reference, lack of information, or uncertain facts; counting the number of confirmed ambiguous sentences of each type, identifying the type with the most number as the main ambiguity type, and selecting all ambiguous sentences belonging to the main ambiguity type as target sentences when the number of sentences is the most numerous, according to preset rules.

[0016] Furthermore, a shared resource set is constructed, including: extracting actions, entities, attributes, and relationships from the two interpretations of each target sentence; aligning common operations and entity identifiers in the two interpretations; comparing operations, targets, conditions, parameters, order, and dependencies; and recording differences that can change operation requirements. Based on the differences, distinguishing resources are generated to give the two interpretations different operation requirements, while retaining shared background resources required to perform related operations. The distinguishing resources and shared background resources corresponding to each target sentence are merged and deduplicated to form a resource set shared by the original version and the two disambiguation versions. The agent is provided with tasks, text context, and allowed operations, but not with interpretation comparison results, specified interpretations, or expected operation sequences.

[0017] Furthermore, each target sentence undergoes local disambiguation rewriting, including: fixing the two interpretations and their direction numbers for each target sentence before executing the agent, clarifying the first or second interpretation with minimal syntactic changes, and retaining the corresponding interpretation's action, object, scope, condition, quantity, and order requirements; replacing all target sentences with the rewriting corresponding to the first interpretation to obtain the first disambiguation version, and replacing all target sentences with the rewriting corresponding to the second interpretation to obtain the second disambiguation version; verifying the completeness of the target sentence replacement and the consistency of non-target text, and verifying whether the rewriting conforms to the corresponding interpretation, eliminates target ambiguity, and does not introduce additional requirements; outputting a failure or pending review status for cases where the interpretation is unreasonable, the rewriting adds requirements, or there are conflicts between fixed interpretations, and not considering versions that fail the verification as valid disambiguation versions.

[0018] Furthermore, the agent is made to run repeatedly in the virtual software space under the original version, the first disambiguation version, and the second disambiguation version, including: constructing an initial interaction history based on the current skill instruction version, shared task, and text context, and initializing the currently running operation request record to empty; the large language model generates tool requests based on the interaction history, and after verification by the request dispatcher, if it is a read request, the preset resource facts are returned based on the resource snapshot without changing the operation request record; if it is a valid action request, the operation in the tool request is appended and the record status and the updated operation request record are returned; the tool request and tool response are appended to the interaction history, and subsequent tool requests are continued to be generated until the agent stops or the unified set upper limit of interaction rounds or upper limit of tool calls is reached.

[0019] Furthermore, repeated runs under the original version, the first disambiguation version, and the second disambiguation version also include: each of the original version, the first disambiguation version, and the second disambiguation version is executed at least twice; each version uses the same pre-determined set of random seeds, and the same initial resources, initial interaction conditions, and no-operation request records are restored before each run; the version identifier, random seed, model and running parameters, tool requests, tool responses, and termination status are recorded, and the running records of the original version are used for comparison with the first disambiguation version and the second disambiguation version; for each comparison, the distance between each run of the original version and each run of the disambiguation version is calculated, and not limited to the distance between runs corresponding to the same random seed.

[0020] Furthermore, the operation names are extracted from the records of each valid run in the order of invocation, and duplicate invocations are retained. This includes: extracting the operation name field from the action request from the complete and valid run records, arranging the operation names in the order of the requests, without sorting or deduplication; representing runs that end normally without requesting any action as an empty sequence, and distinguishing runs that fail or have incomplete records from empty sequences; using the operation name as a sequence element, calculating the edit distance by the minimum number of insertions, deletions, and replacements required to transform one operation sequence into another, and normalizing the edit distance using the maximum value between the lengths of the two operation sequences and the value 1.

[0021] Further, the separation interval is calculated as follows: each operation sequence of the original version is paired with an operation sequence of a disambiguation version to form an inter-version distance set and the minimum value of the inter-version distance set is taken; within the original version and the disambiguation version, the distances of operation sequences with different run numbers are calculated, and the distances within the version are merged to obtain an intra-version distance set and the maximum value of the intra-version distance set is taken; the minimum value of the inter-version distance set is subtracted from the maximum value of the intra-version distance set to obtain the separation interval corresponding to the disambiguation version; operation sequences with different run numbers are allowed to have the same content, and the zero distance corresponding to the same content is retained in the intra-version distance set.

[0022] Furthermore, the output detection results include: the detection results include the control status and change category; when the minimum value of the inter-version distance set is greater than the maximum value of the intra-version distance set, the corresponding control is marked as strictly separated; when the minimum value of the inter-version distance set is equal to zero, it is marked as having the same operation sequence across versions; when the minimum value of the inter-version distance set is greater than zero and not greater than the maximum value of the intra-version distance set, it is marked as operation sequences not overlapping but the separation interval is insufficient; for operation sequence pairs in controls that satisfy strict separation, the operation name set, the number of calls for each operation, and the call order are compared in turn, and changes in the operation set, the number of calls for each operation, or the call order are recorded. When the operation sequence pair corresponding to the same skill instruction involves multiple change categories, it is recorded as a mixed change.

[0023] To achieve the above objectives, according to a second aspect of the present invention, a system for detecting the impact of syntactic ambiguity in agent skill instructions is provided. The system includes: a target sentence and resource construction module, used to acquire agent skill instructions to be detected, identify target sentences with two reasonable syntactic interpretations, structure the two interpretations and identify their operational differences, and thereby construct a shared resource set, task, text context, and permitted operations; a disambiguation version generation module, used to retain the original version of the agent skill instructions, fix the first and second interpretations of each target sentence, perform local disambiguation rewriting on each target sentence to obtain a first disambiguation version and a second disambiguation version, while keeping non-target text unchanged; and a controlled execution module, used to construct a virtual software space based on the shared resource set, including resource snapshots, reading interfaces, action interfaces, and request dispatchers, enabling the agent to perform the same tasks, text contexts, permitted operations, and tool response rules. With the intelligent agent configuration, the system repeatedly runs in the virtual software space under the original version, the first disambiguation version, and the second disambiguation version. Before each run, the resource snapshot, interaction history, and operation request records are reset. The reading interface returns the preset resource facts, and the action interface verifies and records the operation requests without executing the actual system actions. The operation sequence extraction module is used to extract the operation names from the records of each valid run in the order of invocation and retain repeated invocations to form the operation sequences of each version. The separation interval determination module is used to determine the separation interval for the comparison between the original version and each disambiguation version. If each version of the comparison has at least two valid runs, the separation interval is obtained by subtracting the maximum distance between different running operation sequences within each of the two versions of the comparison from the minimum distance between the operation sequences of different versions. When at least one separation interval is greater than zero, the detection result of strict separation and the corresponding operation sequence and separation interval are output.

[0024] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:

[0025] This invention selects resource states based on the operational differences between two syntactic interpretations, enabling the test to touch upon behavioral differences that are not easily apparent under normal input and reducing interference from irrelevant resources; at the same time, it does not provide the tested agent with interpretation comparison results or specify interpretations, thus avoiding the test resources themselves from leaking the expected answer.

[0026] This invention reads preset facts, verifies operation requests, and returns simulated receipts in a unified virtual software space. It only records the operations selected by the agent without executing real system actions, reducing the dependence on real service deployment, state recovery, and actual writing, and providing consistent comparison conditions for different skill instruction versions.

[0027] This invention preserves the original text and two partially disambiguated versions, enabling the detection of behavioral differences that occur only in a certain interpretation direction, and limiting interference caused by irrelevant modifications through non-target text consistency checks.

[0028] This invention obtains the separation interval by subtracting the maximum call chain distance within a version from the minimum call chain distance between versions, and outputs a judgment result with specific execution records, avoiding making a judgment based on only one call chain change; the operation sequence retains the number of calls and the order of calls for each operation, which can identify situations where the operation set is the same but the execution method is different.

[0029] The specific embodiments of the present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description

[0030] The accompanying drawings, as part of this invention, are provided to further illustrate the invention. The illustrative embodiments and descriptions of the invention are used to explain the invention, but do not constitute an undue limitation thereof. Clearly, the drawings described below are merely some embodiments; those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0031] Figure 1 This is a schematic diagram of the overall process of the method for detecting the impact of syntactic ambiguity in agent skill instructions in this specific embodiment.

[0032] Figure 2 This is a schematic diagram of the shared resource construction process in this specific embodiment.

[0033] Figure 3 This is a schematic diagram of the controlled execution process of the virtual software space in this specific embodiment.

[0034] Figure 4 This is a schematic diagram of the repetitive sensing trajectory analysis process in this specific embodiment.

[0035] Figure 5This is a schematic diagram of the structure of the intelligent agent skill instruction syntactic ambiguity behavior impact detection system in this specific embodiment. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments will be clearly and completely described below with reference to the accompanying drawings. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0037] In the following description, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0038] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0039] In this embodiment, an agent skill refers to a data structure that provides task processing knowledge to a large language model agent in the form of a loadable instruction package. The skill package typically includes a skill description file, reference materials, scripts, and other resources; the skill description file is a natural language instruction file named SKILL.md. This specification refers to the natural language instructions in the skill package used to guide the agent's operation as skill instructions. Syntactic ambiguity refers to the phenomenon that the same natural language instruction can have two reasonable syntactic structures and corresponding meanings due to differences in the attachment position of modifiers, phrase combinations, parallel ranges, restoration of omitted components, or subject structure; the sentence with two reasonable syntactic interpretations is called the target sentence, and the two interpretations are referred to as the first interpretation and the second interpretation, respectively. A disambiguation version refers to a version where the target sentence is partially rewritten to express only one interpretation while retaining the rest of the original skill instruction text; the version that retains the original text is called the original version.

[0040] In this embodiment, the shared resource set refers to the resource set obtained by merging and deduplicating distinguishable resources and shared background resources. Based on this set, tasks, text contexts, resource snapshots, and permitted operations are generated for use by both the original version and the two disambiguation versions. The resource states that cause different operational requirements in the two interpretations are called distinguishable resources, and the background information necessary to perform the relevant operations is called shared background resources. The virtual software space refers to the execution space that simulates the task environment using resource snapshots and controlled tool interfaces. A resource snapshot is a pre-set set of resource facts returned by the read interface. The read interface is a simulated interface that returns pre-set resource facts. The action interface is a simulated interface that verifies and records operation requests and returns simulated receipts. The request dispatcher is a component that distributes tool requests generated by the agent to the read interface or action interface based on the request type and returns rejection information for requests that do not meet the interface constraints. A simulated receipt refers to feedback on the reception, rejection, or recording status of a request in the virtual software space and does not indicate that the actual business operation has been completed. Effective operation refers to a normal termination or reaching a unified upper limit, with complete records of tool requests, tool responses, and termination status.

[0041] In this embodiment, the operation sequence refers to the sequence of operation names arranged in the order in which action requests occur, retaining the number of calls and the order of calls for each operation; the edit distance refers to the minimum number of insertions, deletions, and replacements required to transform one operation sequence into another. The separation interval refers to the difference between the minimum value of the distance set between versions in the same comparison and the maximum value of the distance set within a version; a separation interval greater than zero indicates that the difference between the closest pair of call chains between two versions is still greater than the maximum runtime fluctuation observed within the same version, and this state is called strict separation.

[0042] Please see Figure 1 This invention provides a method for detecting the impact of syntactic ambiguity in intelligent agent skill instructions, comprising the following steps:

[0043] S1. Obtain the skill instructions of the agent to be detected, identify the target sentence with two reasonable syntactic interpretations, structure the two interpretations and identify their operational differences, and construct a shared resource set, task, text context and allowed operations accordingly.

[0044] S2. Retain the original version of the agent's skill instructions, fix the first and second interpretations of each target sentence, and perform local disambiguation rewriting on each target sentence to obtain the first and second disambiguation versions, while keeping the non-target text unchanged.

[0045] S3. Construct a virtual software space based on a shared resource set, including resource snapshots, read interfaces, action interfaces, and request dispatchers. This allows agents to repeatedly run in the virtual software space under the same task, text context, allowed operations, tool response rules, and agent configuration, in the original version, the first disambiguation version, and the second disambiguation version. Before each run, the resource snapshot, interaction history, and operation request records are reset. The read interface returns the preset resource facts, and the action interface verifies and records the operation requests without executing real system actions.

[0046] S4. Extract the operation names from the records of each valid run in the order of call and retain duplicate calls to form the operation sequence of each version;

[0047] S5. For the control consisting of the original version and each disambiguation version, if each version of the control has at least two valid runs, the separation interval is obtained by subtracting the maximum distance between different run operation sequences within each of the two versions of the control from the minimum distance between the operation sequences of different versions; when at least one separation interval is greater than zero, the detection result of strict separation and the corresponding operation sequence and separation interval are output.

[0048] Please see Figure 1 and Figure 2 The shared resource construction corresponds to step S1, which receives the original skill instructions and outputs the target sentence, two interpretations, and shared test input. The controlled execution of the virtual software space corresponds to steps S2 and S3, which use the target sentence and interpretation to generate a comparison version and collect the running records under the same task, resource, and tool rules. The repeated perception trajectory analysis corresponds to steps S4 and S5, which convert the valid running records into operation sequences and calculate the separation interval. The interpretation comparison information is only used for resource construction and disambiguation rewriting and is not used as an operation prompt for the tested intelligent agent.

[0049] Example 1: Building Shared Resources

[0050] Please see Figure 1 The first major module and Figure 2 This embodiment takes the original skill command as input and completes the following steps in sequence to output the target sentence and its explanation record, as well as the test input shared by the three versions, to Embodiment 2.

[0051] A1. Input the original skill command

[0052] Retrieve the main text of the skill description file from the skill pack, divide it into sentences, operation list items, workflow steps, and table cells with instruction meaning in the original order, and save the original text, chapter position, and occurrence number of each instruction cell. Ordinary metadata, descriptive titles, code, and examples for demonstration purposes are not directly used as action instructions; they are only included in the detection when a part actually requires the agent to perform an operation.

[0053] A2. Selecting the target sentence and two syntactic explanations

[0054] Examine the original text and its context to determine if two reasonable syntactic structures exist within the same set of texts. Each positive result should be supported by locatable evidence from the original text, two different structures, a corresponding explanation without adding facts, and the grammatical and contextual validity of each explanation. The task description can be used to determine the relevance of subsequent execution, but cannot be used to fabricate or favor a particular syntactic explanation.

[0055] Table 1: Types of Syntactic Ambiguity and Detection Content

[0056]

[0057] The five structural categories listed in Table 1 constitute the detection range of one embodiment. Instructions with only ambiguous word meanings, unclear referents, or insufficient task information are not judged as syntactic ambiguities; uncertain external facts are also not considered syntactic ambiguities. For candidates that cannot simultaneously support two reasonable structures, the reasons for exclusion or the status of pending review are recorded, without adding background facts to make them meet the conditions.

[0058] The number of confirmed ambiguous sentences of each type is counted, and the type with the most occurrences is determined as the primary ambiguous type for the skill instruction. When there are multiple types with the most occurrences, a pre-defined rule is used, such as determining the type by its number from front to back. All ambiguous sentences under this primary type are selected as target sentences, and their original positions and two interpretations are recorded. Target selection is completed before the agent executes the instruction, and the target or interpretation direction is not changed based on the execution result.

[0059] In some embodiments, identifying target sentences with two reasonable syntactic interpretations includes: extracting instruction units with operational meaning according to the order of the source text, saving the original text, position and occurrence number, and detecting modification attachment ambiguity, phrase combination ambiguity, parallel structure ambiguity, ellipsis structure ambiguity and new subject structure ambiguity in combination with the instruction units and their context; retaining two interpretations with different syntactic structures that are reasonable in both grammar and context for the same original text, excluding differences caused only by word meaning, reference, lack of information or uncertain facts; counting the number of confirmed ambiguous sentences of each type, determining the type with the most number as the main ambiguity type, and selecting all ambiguous sentences belonging to the main ambiguity type as target sentences when the number of sentences is the most numerous according to preset rules.

[0060] Specifically, an instruction unit can be a complete sentence, an operation list item, a workflow step, or a table unit with instruction meaning. Modifier attachment ambiguity refers to a modifier that can limit both the preceding and following actions; for example, a conditional clause can act on the entire parallel structure or only on the last verb. Phrase combination ambiguity refers to the same group of words forming different noun phrases or verb phrase boundaries. Parallel structure ambiguity refers to the combination hierarchy or shared modifiers between parallel items, where the scope of the condition is not unique. Ellipsis structure ambiguity refers to the fact that the omitted position can be restored to different syntactic components. New subject structure ambiguity refers to the fact that the same noun phrase can serve as the subject of a new clause, or as the object or modifier in the current structure. All five types of ambiguity require that the same original text contain two locatable syntactic structures. Sentences with only polysemy, unclear pronoun references, or lack of external facts are not included in the target sentence. During statistics, each target sentence is counted only once in its primary type to avoid the same sentence being counted repeatedly in multiple types.

[0061] A3. Structured Actions, Entities, Attributes, and Relationships

[0062] Each target sentence is converted into two separate structured records based on its two interpretations. Records include actions, entities, attributes, and relationships. Actions describe the operations performed, entities describe the objects of those operations, and attributes and relationships describe states, scopes, conditions, or dependencies. The same entity and operation in both types of records use aligned identifiers, while differences in condition bindings and order are preserved separately.

[0063] A4. Identify the operational differences between the two interpretations.

[0064] Based on the structured record obtained in step A3, align the corresponding actions and objects in the two interpretations, and compare the operations, goals, conditions, parameters, order, and dependencies in sequence. Eliminate differences that are merely synonymous expressions, retain differences that may alter operational requirements, and summarize all differences in the target sentences as the basis for generating candidate resources. This step does not predetermine the operation that the tested agent should ultimately perform.

[0065] A5. Generate candidate resources based on entities and attributes.

[0066] For each target sentence, candidate resources and their states are generated based on the entities, attributes, and relationships in step A3 and the operational differences in step A4. Candidate resources should provide readable objects and contexts for the operations involved and cover attributes that may change conditional judgments, object selections, or execution order; candidate resources should not contain expected call chains or specified interpretations.

[0067] A6. Filter and differentiate resources and necessary sharing backgrounds

[0068] Resource states that give the two interpretations different operational requirements are selected from the candidate resources as differentiating resources; at the same time, the background information necessary for performing the relevant operations is retained as shared background resources. Resource selection is based on the requirements of the two interpretations, and not on the reverse selection of interpretations based on the results of the tested agent's operation.

[0069] Taking the report processing instruction "Review and publish the report if approved." as an example, the first interpretation requires the report to be reviewed and published only after approval, while the second interpretation requires the report to be reviewed but only published after approval. The operations required by the two interpretations change depending on the report status, as shown in Table 2. The table is a schematic representation of the interpretation requirements, not the actual test results of the agent.

[0070] Table 2: The Differentiating Effect of Report Status on the Two Interpretations

[0071]

[0072] Accordingly, the same report with an "unapproved" status is provided as a distinguishing resource, retaining necessary information such as the report identifier and text. The resource does not contain conclusions of "should be reviewed" or "should not be reviewed," nor does it present a comparison of the two interpretations to the tested agent. In this way, the task and resource provide the conditions for behavioral differences to occur; the specific actions are still determined by the agent based on the loaded skill instructions.

[0073] A7. Merge and remove duplicates to form shared resources.

[0074] Merge the distinguishing resources for each target sentence with the shared background resources:

[0075]

[0076] in, The number of target sentences; For the merged set of shared resources; For the first A set of distinguishable resources for each target sentence; For the first The necessary shared background resource set for each target sentence; This indicates a set union operation. `i` is the target sentence index, ranging from 1 to `m`. The large union symbol represents the union of the resource sets of all target sentences. During the merge, duplicate resources are removed, but attributes and relationships used to display different operational requirements are retained. Shared background resources are part of the shared resource set and are not equivalent to the entire shared resource set.

[0077] A8. Task Generation, Context, and Allowed Operations

[0078] The final output includes a shared task, text context, resource snapshot, and permitted operations for execution across the three versions. The readable facts within the resources remain consistent across the same discriminant; if the target involves multiple instructions, their resource requirements are consolidated to avoid generating distinct environments for different disambiguation versions.

[0079] In some embodiments, constructing a shared resource set includes: extracting actions, entities, attributes, and relationships from the two interpretations of each target sentence; aligning common operations and entity identifiers in the two interpretations; comparing operations, targets, conditions, parameters, order, and dependencies; and recording differences that can change operation requirements; generating distinguishing resources based on the differences that give the two interpretations different operation requirements, and retaining shared background resources required to perform related operations; merging and deduplicating the distinguishing resources and shared background resources corresponding to each target sentence to form a resource set shared by the original version and the two disambiguation versions; and providing the agent with tasks, text context, and allowed operations, without providing interpretation comparison results, specified interpretations, or expected operation sequences.

[0080] Specifically, the structured records for both interpretations can use the same entity identifier table and the same operation identifier table. The entity identifier table records the entity name, type, and resource path, while the operation identifier table records the operation name, parameter mode, and return mode. During alignment, the same entity or operation uses the same identifier in the records of both interpretations, retaining differences only in condition binding, parameter values, execution order, or dependencies. When generating differentiated resources, corresponding resource states are set for each difference that can change the operation requirements, such as whether the object is approved, whether the file exists, whether the list is empty, or whether the record already exists. When generating shared background resources, the information necessary to complete the operation, such as the object text, path, and identifier, is retained. During merging and deduplication, duplicates are removed using the resource identifier and state value as keys, but attributes of the same resource that need to present different states under different target sentences are retained separately. The final output task, text context, resource snapshot, and allowed operations constitute the test input shared by the three versions, which does not include the comparison results of the two interpretations, the specified interpretation, or the expected operation sequence.

[0081] Example 2: Controlled Execution of Virtual Software Space

[0082] Please see Figure 1 The second major module and Figure 3 This embodiment receives the original instruction, target sentence, and its two interpretations output from Embodiment 1, as well as shared tasks, resource snapshots, text context, and allowed operations. It then sequentially completes the following steps, outputting the execution records for three skill instruction versions. The target sentence interpretation is used to generate comparison text, and the shared resources are used to configure the same execution conditions.

[0083] B1. Rewrite the target sentence partially according to the two interpretations.

[0084] Within a controlled execution framework, bidirectional disambiguation is used to construct the comparison input. Let the original skill instruction be... , No. The target sentence is Before execution, the first and second interpretations are fixed. Each interpretation undergoes minimal local rewriting, clarifying only existing syntactic relations without adding facts, permissions, tools, task requirements, or answers. The rewritten actions, objects, scope, conditions, quantity, and order must remain consistent with the corresponding selected interpretation.

[0085] For example, the reporting instruction could be partially changed to "If the report is approved, review and publish it." and "Review the report, and publish it only if it is approved." The rewrite only clarifies the scope of the approval conditions; the report status remains derived from shared resources; neither version adds new report content or task objectives.

[0086] B2. Verification of consistent interpretation without adding requirements.

[0087] The program reconstructs a complete version based on the original text location and replacement records, checking whether all target sentences have been replaced and whether non-target characters have been completely preserved. It further examines whether the rewrite conforms to the specified interpretation, whether target ambiguity has been eliminated, whether any additional requirements have been introduced, and whether all non-target ambiguities, including those within the target sentence, have been preserved. If preservation is not possible, the program records the reason for the block and returns to the kernel. If there is a conflict between fixed interpretations or non-target content cannot be preserved, the program records the reason for the block and returns to the kernel, without forcibly generating a comparison by swapping interpretation directions or changing other sentences.

[0088] B3. Retain the original version and generate two disambiguation versions.

[0089] Construct a disambiguation version using substitution relations:

[0090]

[0091] in, For the first A disambiguation version; These are the original skill commands; For the first One target sentence; For the target sentence In the Rewriting under this interpretation; The number of target sentences; This indicates a replacement operation based on the position of the target sentence. i ranges from 1 to m, j is the interpretation direction number, which is 1 or 2; the mapping arrow indicates that the replacement is a corresponding rewrite, and the curly braces indicate the replacement relationship of all target sentences. Replace each target sentence with a rewritten version of the first explanation. Replace each target sentence with a rewritten version of the second interpretation. These are two pre-defined combinations of sentence-level interpretations, and do not represent an exhaustive list of all possible interpretations for the entire skill instruction.

[0092] In some embodiments, local disambiguation rewriting is performed on each target sentence, including: fixing the two interpretations and their direction numbers of each target sentence before executing the agent, clarifying the first or second interpretation with minimal syntactic changes, and retaining the action, object, scope, condition, quantity, and order requirements of the corresponding interpretation; replacing all target sentences with the rewriting corresponding to the first interpretation to obtain a first disambiguation version, and replacing all target sentences with the rewriting corresponding to the second interpretation to obtain a second disambiguation version; verifying the completeness of the target sentence replacement and the consistency of non-target text, and verifying whether the rewriting conforms to the corresponding interpretation, eliminates target ambiguity, and does not introduce additional requirements; outputting a failure or pending review status for cases where the interpretation is unreasonable, the rewriting adds requirements, or there are conflicts between the fixed interpretations, and not considering the version that fails the verification as a valid disambiguation version.

[0093] Specifically, the direction number is used to identify the interpretation direction corresponding to each disambiguation version in subsequent running records and distance calculations. The first disambiguation version corresponds to the first interpretation, and the second disambiguation version corresponds to the second interpretation. The number is determined and recorded before the agent is executed and is not exchanged based on the running results. Minimal syntactic modification refers to adjusting only the attachment position of modifiers, completing parallel levels, or restoring omitted components within the scope of the target sentence, so that the target syntactic structure clearly expresses the selected interpretation and excludes another target interpretation, while keeping the action, object, scope, condition, quantity, and order requirements of the selected interpretation unchanged, and retaining non-target ambiguities. During verification, the rewritten sentence is aligned with the structured record of the selected interpretation, and the action, object, scope, condition, quantity, and order requirements are compared item by item; if there are additions, deletions, or changes, the verification fails. After the replacement, the program concatenates the non-target text according to the original position, comparing the differences before and after the replacement character by character to confirm that no other characters have changed except for the target sentence. If a target sentence is not replaced, the replacement position is incorrect, the rewrite cannot determine the interpretation, or there is a conflict between fixed interpretations within the same disambiguation version, the output will show a failure or a pending review status, and that version will not participate in subsequent runs. Verification can also be performed by an independent large language model to check whether the rewrite retains the selected interpretation and excludes another interpretation; if the review fails, it will also be returned to the review process.

[0094] B4. Unify the rules for tasks, resources, and tools.

[0095] The original version and the two verified disambiguation versions are configured with the same tasks, text context, resource snapshots, allowed operations, tool response rules, models, and runtime limits. The virtual software space represents the task environment using resource snapshots and controlled tool interfaces, preserving agent decisions, interaction history, request distribution, and termination control; action requests are only verified and recorded within this space. Specific control relationships are shown in Table 3.

[0096] Table 3: Contents that remain consistent and changes during controlled execution

[0097]

[0098] B5. Reset initial state before each run.

[0099] As shown in Table 3, the input differences for controlled comparisons are limited to the target sentence expression of the skill instruction. Each run establishes an independent interaction history and initializes the no-operation request record. This initialization does not mean clearing skill instructions and tasks, but rather reloading the current version and the same shared tasks and context to prevent requests and responses from the previous run from entering the next run.

[0100] B6. Agent Decision-Making and Simulation Tool Interaction

[0101] In a virtual software space, the interaction between an intelligent agent and a simulation tool can be represented as:

[0102]

[0103]

[0104]

[0105] in, This refers to the sequence number of the interaction rounds; For the first The interaction history of the wheel; Requests for tools generated for large language models; This is a snapshot of the aforementioned shared resource set during its current operation. Record the current operation request; For tool response; For request dispatcher; This indicates that tool requests and tool responses are appended to the interaction history. LLM represents the mapping of tool requests generated by the large language model; t starts from 0, and the subscript t+1 represents the operation request record and interaction history after this round of updates, respectively. The above updates form a closed loop of agent decision-making, tool response, and subsequent decisions.

[0106] In one implementation, the read interface is named `text_read`, and the action interface is named `text_act`. For valid read requests, the dispatcher returns the preset facts in the resource snapshot, and the operation request record remains unchanged. For valid action requests, the dispatcher appends the operation in the request to the record, returns the record status and the updated record, and does not perform any actual archiving, writing, or sending actions. For requests that do not meet the interface constraints, a rejection message is returned according to the unified verification rules.

[0107] The above response is called a simulated receipt, which confirms the acceptance, rejection, or recording status of the request in the virtual software space, rather than whether the actual business operation has been completed. Resource facts and operation request records are stored separately, and the recording of action requests does not automatically cause the pre-defined resource facts to evolve according to the rules of the real system. The agent can still adjust subsequent requests based on the receipt, so its tool selection can be observed without deploying corresponding external services.

[0108] In some embodiments, the agent is made to run repeatedly in the virtual software space under the original version, the first disambiguation version, and the second disambiguation version, respectively. This includes: constructing an initial interaction history based on the current skill instruction version, the shared task, and the text context; initializing the currently running operation request record to empty; generating tool requests by the large language model based on the interaction history; after verification by the request dispatcher, if it is a read request, returning the preset resource facts based on the resource snapshot without changing the operation request record; if it is a valid action request, appending the operation in the tool request record and returning the record status and the updated operation request record; appending the tool request and tool response to the interaction history, continuing to generate subsequent tool requests until the agent stops or reaches the uniformly set interaction round limit or tool call limit.

[0109] Specifically, the initial interaction history consists of the current skill instruction version, shared task, and text context, and can be written according to the dialogue format required by the tested agent; the operation request record is set to empty at the start of each run. The request dispatcher first determines whether the request is a permitted operation and whether the parameters meet the interface constraints. If not, it returns a rejection message without changing the operation request record; for read requests, the dispatcher reads the corresponding facts from the resource snapshot and returns them; for action requests, the dispatcher records the operation name and parameters, and returns the record status and the updated record. Tool requests and tool responses are both appended to the interaction history, enabling the agent to adjust its decisions in subsequent rounds based on simulation feedback; the current run terminates when the agent actively ends or reaches the unified upper limit of model interaction rounds and the upper limit of tool call counts.

[0110] B7. Save request, response, and termination status.

[0111] In a single run, the run stops when the agent chooses to end, or when the maximum number of model interaction rounds or tool calls is reached (as per a predefined limit). The version identifier, seed, model and runtime parameters, tool requests, tool responses, and termination status are saved. The completeness and validity of the records are checked, and runs that fail, have interface errors, or have missing records are marked; such runs are not simply interpreted as inaction. Runs that fail or have incomplete records retain their original records and are marked separately, and are not included in subsequent distance calculations.

[0112] B8. Run each version repeatedly and collect logs.

[0113] Using a pre-defined set of identical seeds, steps B5 through B7 are repeated for the original version and the two disambiguation versions, and valid logs are collected. In one embodiment, each version is run three times, for a total of nine runs; the three trajectories of the same original version are used simultaneously in both disambiguation directions, eliminating the need to run the original version again for each direction. The number of repetitions can also be set to at least two. The output includes request, response, and termination statuses associated with the version and run identifier, which are used in Embodiment 3 for operation sequence projection and distance comparison.

[0114] In some embodiments, repeated running under the original version, the first disambiguation version, and the second disambiguation version further includes: each of the original version, the first disambiguation version, and the second disambiguation version is executed at least twice; each version uses the same predetermined set of random seeds, and restores the same initial resources, initial interaction conditions, and no-operation request records before each run; records the version identifier, random seed, model and running parameters, tool requests, tool responses, and termination status, and uses the running records of the original version for comparison with both the first disambiguation version and the second disambiguation version; for each comparison, calculates the distance between each run of the original version and each run of the disambiguation version, but not limited to the distance between runs corresponding to the same random seed.

[0115] Specifically, the same random seed set refers to the three versions using the same random seed value for the corresponding run number to reduce the interference of sampling randomness on the comparison; even if the temperature is set to zero, the actual records of repeated runs of the same version are still compared, without presuming that the execution will necessarily be completely consistent. Before each run, the resource snapshot is restored to the initial state in the shared resource set, the interaction history is reconstructed, and the operation request record is cleared, thereby preventing the state of the previous run from entering the next run. Run records are saved in association with version identifier, run number, and random seed. Each run of the original version participates in pairing with both the first disambiguation version and the second disambiguation version; during pairing, all run combinations of the two versions are traversed, not limited to the two records with the same random seed.

[0116] Example 3: Repetitive Sensing Trajectory Analysis

[0117] Please see Figure 1 The third major module and Figure 4 This embodiment receives the valid operation records output from Embodiment 2, forms an operation sequence in the following order, compares the distances between and within versions, and outputs the separation interval and change category in the observed samples.

[0118] C1. Extract action operation names from valid logs.

[0119] From the complete and valid tool call logs, extract the `operation` field of the `text_act` (action request interface) requests in chronological order, treating each operation name as a sequence element. The `text_read` calls that retrieve facts are not included in this simulated tool operation sequence, nor are the operation parameters and final task results included in this distance metric, but they can be retained in the original logs for review.

[0120] C2. Arrange the operation sequence according to the order of invocation.

[0121] The operation sequence is represented as:

[0122]

[0123] in, For operation sequences; For the first The operation name requested by the action; `t` represents the number of action requests. In this formula, `t` is the action request number, counting from 1 to the total number of action requests; the sequence is empty when there are no action requests. The sequence is not deduplicated or rearranged. In the following examples, `archive` represents the archiving operation, and `notify` represents the notification operation. For example, `(archive,archive, notify)` and `(archive, notify)` contain the same set of operation names, but `archive` is called at different numbers; `(archive, notify)` and `(notify, archive)` have different orders when the number of calls to each operation is the same. A normal execution without any requested actions is represented by an empty sequence.

[0124] C3. Calculate the normalized edit distance

[0125] The distance between the two operation sequences is:

[0126]

[0127] in, and Given two operation sequences; the function d represents the normalized edit distance between the two sequences; max represents taking the maximum value of each parameter; To make the operation sequence Convert to The minimum number of insertions, deletions, or replacements required, with each edit applied to an element with the operation name; and These represent the sequence lengths; the 1 in the denominator is used to avoid division by zero when both sequences are empty. The normalized distance ranges from 0 to 1, with zero indicating that the operation names, the number of times each operation is called, and their order are exactly the same. Cases with different call parameters but the same sequence of operation names are not distinguished by this distance.

[0128] In some embodiments, extracting operation names from the records of each valid run in the order of invocation and retaining duplicate invocations includes: extracting the operation name field from the action request from the complete and valid run record, arranging the operation names in the order in which the requests occurred, without sorting or deduplication; representing runs that end normally without requesting any action as an empty sequence, and distinguishing runs that fail to execute or have incomplete records from the empty sequence; using the operation name as a sequence element, calculating the edit distance by the minimum number of insertions, deletions, and replacements required to transform one operation sequence into another, and normalizing the edit distance by the maximum value between the lengths of the two operation sequences and the value 1.

[0129] Specifically, the operation name field is the field in the action request that identifies the operation being invoked, such as the operation (operation name) field in the text_act (action request interface) request. Requests to read facts are not included in the operation sequence but are retained in the raw log for review. Runs that end normally without requesting any action are represented as empty sequences. Empty sequences differ from runs that fail or have incomplete records: the former is a valid run result, while the latter is not included in the calculation of inter-version and intra-version distances. For valid runs, sequence elements are arranged in the order in which the requests occurred, and repeated operations are retained repeatedly. When calculating edit distance, insertion, deletion, and replacement are all performed on a unit of one operation name element, and the normalized denominator is the maximum of the two sequence lengths and 1.

[0130] C4. Compare the original version with the two disambiguated versions respectively.

[0131] Using the runtime records of the same original version as a common benchmark, two comparisons are established: one between the original version and the first disambiguation version, and the other between the original version and the second disambiguation version. Each comparison calculates its own inter-version distance set and intra-version distance set, without substituting the distance between the two disambiguation versions for the comparison between the original version and the disambiguation version.

[0132] C5. Calculate the distance between versions and take the minimum value.

[0133] make Indicates the original version number The sequence of operations for each run. Indicates the first The first disambiguation version The sequence of operations for each run, where Choose 1 or 2. Pair each original version sequence with each sequence of the corresponding disambiguated version to obtain the set of inter-version distances:

[0134]

[0135] in, For the first A set of inter-version distances in each disambiguation direction; and The original version and the version respectively Each disambiguation version has at least 2 valid runs; and These are the run numbers for the two versions. The inequality following the vertical bar in the set limits the range of values ​​for the run numbers, where j is either 1 or 2. When each version has three valid runs, the distances between the nine versions are obtained. This includes cross-pairing between different seeds, not just comparing two trajectories from the same seed, to check for overlap or proximity between the entire observation sequences of the two versions.

[0136] C6. Calculate the distance within each version and take the maximum value.

[0137] The distance set within a version is:

[0138]

[0139] in, For the first The set of in-version distances in each disambiguation direction; Take 0 or , respectively representing the original version and the version number. A disambiguation version; This represents the number of valid runs for the corresponding version. The two X terms represent the r-th and s-th valid run sequences for version k, respectively; r and s are run numbers, and the great union symbol indicates merging the distance sets of the two currently compared versions. (Constraints) Less than To select different runs and avoid duplicate pairings, the sequence content does not need to be different; if two runs yield the same sequence, their zero distance must still be retained. Each version has three pairs in three runs, and the two versions together yield the distance within six versions.

[0140] C7. Calculate the separation interval

[0141] The separation interval is:

[0142]

[0143] in, For the first Separation interval in each disambiguation direction; This represents the minimum value of the set of distances between versions. This represents the maximum value of the distance set within a version. The minimum distance between versions indicates how much the closest pair of call chains between two versions still differ across all runs; the maximum distance within a version indicates the maximum change observed during repeated runs while maintaining the same skill instruction version. The latter assumes that the task, initial environment, and model configuration are controlled, serving as an observational reference for random fluctuations during runtime, and is not a theoretical bound on all possible random behaviors of the model.

[0144] In some embodiments, calculating the separation interval includes: pairing each operation sequence of the original version with an operation sequence of a disambiguation version to form an inter-version distance set and taking the minimum value of the inter-version distance set; calculating the distance for operation sequences with different run numbers within the original version and the disambiguation version respectively, merging them to obtain an intra-version distance set and taking the maximum value of the intra-version distance set; subtracting the maximum value of the intra-version distance set from the minimum value of the inter-version distance set to obtain the separation interval corresponding to the disambiguation version; operation sequences with different run numbers are allowed to have the same content, and the zero distance corresponding to the same content is retained in the intra-version distance set.

[0145] Specifically, the inter-version distance set consists of all run pairings between the original version and the same disambiguation version, and the pairings are not limited to runs with the same random seed; the intra-version distance set consists of the combined distances between different runs within the original version and the distances between different runs within the disambiguation version. In implementation, for each disambiguation direction, the inter-version minimum is initialized to positive infinity, and the intra-version maximum is initialized to zero. The minimum is updated by iterating through cross-version pairings, and the maximum is updated by iterating through different run pairings within the same version. Finally, the values ​​are subtracted and the result is saved. The above judgment is only executed if the input record is valid and each participating version has at least two runs. If any participating version has fewer than two valid runs, the control is marked as having insufficient valid runs, and its separation interval is not calculated. Two operation sequences with different run numbers retain their zero distance even if their content is identical, thus ensuring that the maximum intra-version distance truly reflects the observed upper limit of fluctuation.

[0146] C8. Determining strict segregation in the observed sample

[0147] when When the value is greater than zero, the distance between any version in the comparison is greater than any distance within the two versions, even for the closest cross-version call chains, the difference still exceeds the maximum fluctuation observed within the same version. After calculating the two directions separately, the case-level results are obtained using the following formula:

[0148]

[0149] in, This is a case-level strict separation judgment result; This is an indicator function that takes the value 1 if the condition is true, and 0 otherwise. and These are the separation intervals for the first disambiguation direction and the second disambiguation direction, respectively. This indicates a logical OR. Only the first direction, only the second direction, and both directions being positive are recorded as different separation directions. When neither direction is positive, the report does not confirm strict separation, but does not claim that syntactic ambiguity necessarily has no effect.

[0150] Table 4: Rules for determining the comparison between a single original version and a disambiguation version

[0151]

[0152] The three cases in Table 4 are mutually exclusive and complete when the distance is non-negative and the number of runs meets the requirement. In the following examples, "review" represents the review operation. To illustrate the calculation process, assume that the original version produces "(review)" in all three runs, and the first disambiguation version produces an empty sequence in all three runs. In this case, the distance between the nine versions is 1, the distance within the six versions is 0, and the separation interval is 1. Conversely, if both versions have produced "(review)" of this sequence, the minimum distance between the versions is 0, and strict separation cannot be satisfied. The above values ​​are algorithm examples and are not experimental results.

[0153] C9. Output separation interval and variation categories

[0154] For cases requiring strict separation, further classification can be performed based on the priority of the operation set, the number of times each operation is called, and the order of calls. First, determine if the operation name sets are different; if the sets are the same, compare the frequency of each operation; if the frequencies are also the same, then compare the order. When the same skill instruction contains multiple sequence pairs within the comparisons that satisfy the separation criteria, summarize them as mixed variations. The output should retain the sequence pairs and their sources for checking the classification criteria.

[0155] In some embodiments, the output detection results and change categories include: the detection results include control status and change category; when the minimum value of the inter-version distance set is greater than the maximum value of the intra-version distance set, the corresponding control is marked as strictly separated; when the minimum value of the inter-version distance set is equal to zero, it is marked as having the same operation sequence across versions; when the minimum value of the inter-version distance set is greater than zero and not greater than the maximum value of the intra-version distance set, it is marked as operation sequences not overlapping but the separation interval is insufficient; for operation sequence pairs in controls that satisfy strict separation, the operation name set, the number of calls for each operation, and the call order are compared in sequence, and changes in the operation set, the number of calls for each operation, or the call order are recorded. When the operation sequence pair corresponding to the same skill instruction involves multiple change categories, it is recorded as a mixed change.

[0156] Specifically, the comparison status is determined according to Table 4, and the corresponding version identifier, operation sequence, and separation interval are retained in the output to ensure that the judgment result can be traced back to the specific execution record. Change categories are determined according to a coarse-to-fine priority: first, the operation name sets of the two operation sequences are compared; if the sets are different, it is recorded as a change in the operation set; if the sets are the same, the frequency of each operation in the sequence is compared; if there is a difference in the frequency, it is recorded as a change in the number of calls for each operation; if the frequency is also the same, the order of the operation names is compared; if the order is different, it is recorded as a change in the call order. When multiple sequence pairs of the same skill instruction involve different categories, they are summarized and recorded as a mixed change. This method measures the difference in the tool call chain after the agent runs, not the edit distance of the skill instruction text, nor is it based on a pre-set correct call chain. Strict separation is evidence from a limited observation sample and cannot guarantee that separation will be maintained in every future execution, nor can it infer the correctness of parameters, business success, or actual damage solely from the operation name sequence.

[0157] Please see Figure 5 Based on the same inventive concept, this invention also provides a system for detecting the impact of syntactic ambiguity in intelligent agent skill instructions. The system receives the original skill instructions and related task information, and outputs the target sentence and explanation record, shared resources, verified comparison version, tool call logs, operation sequence, separation interval, and change category.

[0158] The target sentence and resource construction module includes target selection, interpretation structuring, difference identification, and resource integration processing units. The target selection unit saves the original text evidence and location; the interpretation structuring unit aligns common entities and operations; the difference identification unit determines differences in conditions, scope, objects, parameters, or order; and the resource integration unit merges and distinguishes resources from common context, outputting shared tasks, context, and allowed operations to the controlled execution module.

[0159] The disambiguation version generation module includes a local bidirectional rewriting and verification unit. The verification unit generates two complete comparison versions and checks the consistency of non-target text. For cases where the interpretation is unreasonable, the rewriting adds requirements, or there are conflicts between fixed interpretations, it outputs a failure or pending review status.

[0160] The controlled execution module includes a virtual software space and a runtime scheduling unit. The virtual software space provides preset facts and simulated receipts through a read interface, an action interface, and a request dispatcher; the runtime scheduling unit initializes and resets each run according to a unified configuration, saving complete request, response, and termination states.

[0161] The operation sequence extraction module includes an operation sequence projection unit, which is used to extract the operation name of the action request from the valid operation record, retain the order and repetition of the operation name, and represent the operation that ends normally and does not request an action as an empty sequence.

[0162] The separation interval determination module includes distance calculation, version-inclusive comparison, and result summarization units. The distance calculation unit calculates the normalized edit distance; the comparison unit obtains the separation interval in two directions; the result summarization unit outputs states such as strict separation, cross-version overlap, or insufficient interval, and retains the corresponding operation sequence as a basis for review.

[0163] The aforementioned modules can be implemented by a processor executing corresponding programs. Each module associates resources and logs through skill instructions, target sentences, versions, and runtime identifiers to maintain traceability of results. The program implementing the method can be stored on a computer-readable storage medium and executed by a processor using the aforementioned steps.

[0164] Based on the same inventive concept, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for detecting the syntactic ambiguity of intelligent agent skill instructions as described above.

[0165] The program product of the present invention for implementing the above-described method may employ a portable compact disk read-only memory and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the present invention, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0166] Method Validation

[0167] In a set of method validations, the method described in this invention was implemented to construct 100 synthetic skill instructions covering the five ambiguity types in Table 1, with 20 instructions for each type. Additionally, 41,269 skill records from the ClawHub skill ecosystem platform were collected, and after testing, bidirectional rewriting, and review, simulated tool behavior analysis was conducted on 4,831 cases with valid execution records. The above-mentioned number of original records and the number of valid behavior comparison cases represent sample sizes at different stages; the latter cannot be interpreted as the total number of ambiguous instructions.

[0168] Fifty valid ecosystem cases suitable for local file operations were also selected for real-world tool validation. The three sample groups are different and do not constitute a one-to-one matching experiment between the simulated and real backends for the same sample. Real-world tool validation is used to check execution logs and file changes, independent of the constraints of not performing actual actions in the core virtual software space.

[0169] Table 5: Model and runtime configuration of one implementation method

[0170]

[0171] Table 5 shows the configuration for this set of verifications, without restricting the use of other compatible large language models. Disambiguation generation or repair will be performed a maximum of three rounds. Even if the temperature is set to zero, actual records from repeated runs of the same version will still be compared; complete consistency is not assumed.

[0172] One hundred cases were randomly selected from the ecosystem case studies for manual review, examining two interpretations of the target sentence and their corresponding rewrites. All 100 cases in this sample passed the review; both interpretations were deemed reasonable, and the rewrites retained the selected interpretation without adding information or modifying irrelevant content. This result only describes the reviewed sample and does not represent the detection accuracy rate for all skill instructions or an overall error rate of zero.

[0173] Table 6: Call chain results under three settings

[0174]

[0175] In Table 6, "Call chain unchanged" means that the nine operation sequences obtained from three runs of each of the three versions are completely identical; "Changed but not separated" means that the nine operation sequences are not all identical and the two separation intervals are not greater than zero; "Strictly separated" means that the separation interval in at least one direction is greater than zero. The sum of the three types of results equals the number of valid cases for each setting. The simulated tool sequence takes the operation name from the action request, and the real tool sequence takes the native function name and includes read and write calls.

[0176] Significant fluctuations in the aggregate sequence or in the process itself can affect the separation determination, and the reason for a specific case cannot be judged solely based on the aggregation ratio.

[0177] Table 7: Number of strict separation cases and valid cases for each major type of ambiguity

[0178]

[0179] Table 7 categorizes cases by major ambiguity type, with each cell representing the number of strict separations and the number of valid cases, respectively. Strict separations were observed in all five types in both the synthetic and ecological simulation settings. Since sample sizes differ between types, the results should be interpreted in conjunction with the denominator; the number of separated cases should not be directly considered as evidence that a particular type is more likely to induce behavioral changes.

[0180] Table 8: Separation Coverage in Two Disambiguation Directions

[0181]

[0182] As shown in Table 8, the two directions in the ecosystem simulation setting yielded 120 and 119 separate cases, respectively, with an intersection of 37 cases, totaling 202. Compared to comparing only the first direction, the second direction covers an additional 82 cases. This demonstrates that retaining two pre-determined disambiguation directions can reveal differences not presented by a single direction; this conclusion does not require either direction to represent the author's true intention.

[0183] Table 9: Variation Categories of 202 Strictly Separated Ecosystem Cases

[0184]

[0185] Table 9 categorizes the sequence pairs in the controls that meet the separation criteria according to the priority of Example 3, and then summarizes them according to skill instructions. There are 68 cases in total, 56 categories based on the number of calls and 12 categories based on the call order. The sequence pairs in these cases retain the same set of operations; these differences are lost when only the deduplicated name sets are compared, accounting for 33.7% of the 202 separation cases. The variation in the number of calls refers to the different frequency of each operation, not just the different total length of the entire call chain.

[0186] In real tool execution and file result verification, skill tasks involving file operations are performed in an isolated local directory, recording tool parameters, return results, and file contents before and after execution. Real tool settings are used to verify how operations are reflected as persistent artifacts, avoiding confusion with simulated receipts from virtual software spaces and not involving production systems.

[0187] Table 10: Document Status Changes Confirmed in Fifty Real-World Tool Cases

[0188]

[0189] Table 10 shows the statistics for nine runs of each skill instruction, with each skill instruction within the same category counted only once. A skill instruction can simultaneously perform multiple operations such as text writing and JSON writing, therefore there is overlap between categories, and the sum of the rows cannot be used as the number of independent cases of file changes. These results confirm that local execution causes state changes, but do not individually indicate that the task was correct or that ambiguity caused damage.

[0190] In the user profile maintenance task, under the same random seed, both the original version and the second disambiguation version invoked the tool four times, but the third step invoked `append_file` and `write_file` respectively. The original version appended existing preferences, creating duplicate records and causing the number of profile text tags to differ from the number in the status file; the second disambiguation version rewrote the profile by overwriting, saving the family information example in the skill instructions as personal information lacking user record support. The difference in this case is the tool name and the writing method, not the total number of invocations.

[0191] The aforementioned file issues correspond to the semantics of the interface operations. Appending retains the original content but may result in duplicate writing; overwriting regenerates the file content and may introduce examples that should not be considered facts into the output. A successful tool return only confirms that the request was executed; whether duplicate preferences or unfounded personal information were written still needs to be verified through parameters and file content.

[0192] In a guitar practice log task, the first disambiguation version swapped the call order of `read_json` and `list_files` compared to the original version in one run, but still executed `append_file`. The generated logs differed in title hierarchy, list layout, and separators, but the core practice information remained consistent. This case illustrates that differences in call order can accompany changes in file organization, but differences in the log path and files alone cannot definitively conclude that information is lost, nor can the impact of generation fluctuations on layout be ruled out.

[0193] In the Chinese article review task, the original version path underwent four write operations after reading the article, saving the review draft, the optimized draft, the final draft, and the review report. The first disambiguation version path underwent two write operations, saving one copy of the article and the review report. Content verification showed that all three article drafts were verbatim copies of the original text. The two additional write operations resulted in two extra article files, without any additional article modifications. The use of terms like "optimized draft" or "final draft" alone cannot confirm that any content processing occurred.

[0194] Unless otherwise defined, the technical or scientific terms used in this invention shall have the general meaning understood by one of ordinary skill in the art to which this invention pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this invention do not indicate quantitative limitations and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this invention are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. Words such as “connected,” “linked,” and “coupled” used in this invention are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “A plurality” used in this invention refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. In this invention, the terms "first," "second," "third," etc., are used only to distinguish similar objects and do not represent a specific order of objects.

[0195] Obviously, the accompanying drawings are merely some examples or embodiments of the present invention. Those skilled in the art can apply the present invention to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, certain design, manufacturing, or production modifications made according to the technical content disclosed in the present invention are merely conventional technical means and should not be considered as insufficient disclosure of the present invention.

[0196] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-described technical content to create equivalent embodiments without departing from the scope of the present invention. The implementation schemes in the above embodiments can also be further combined or replaced. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for detecting the impact of syntactic ambiguity in intelligent agent skill instructions, characterized in that, Includes the following steps: S1. Obtain the skill instructions of the agent to be detected, identify the target sentence with two reasonable syntactic interpretations, structure the two interpretations and identify their operational differences, and construct a shared resource set, task, text context and allowed operations accordingly. S2. Retain the original version of the agent's skill instructions, fix the first and second interpretations of each target sentence, and perform local disambiguation rewriting on each target sentence to obtain the first and second disambiguation versions, while keeping the non-target text unchanged. S3. Construct a virtual software space based on a shared resource set, including resource snapshots, read interfaces, action interfaces, and request dispatchers. This allows agents to repeatedly run in the virtual software space under the same task, text context, allowed operations, tool response rules, and agent configuration, in the original version, the first disambiguation version, and the second disambiguation version. Before each run, the resource snapshot, interaction history, and operation request records are reset. The read interface returns the preset resource facts, and the action interface verifies and records the operation requests without executing real system actions. S4. Extract the operation names from the records of each valid run in the order of call and retain duplicate calls to form the operation sequence of each version; S5. For the control consisting of the original version and each disambiguation version, if each version of the control has at least two valid runs, the separation interval is obtained by subtracting the maximum distance between different run operation sequences within each of the two versions of the control from the minimum distance between the operation sequences of different versions; when at least one separation interval is greater than zero, the detection result of strict separation and the corresponding operation sequence and separation interval are output.

2. The method according to claim 1, characterized in that, Identify target sentences with two plausible syntactic interpretations, including: Extract instruction units with operational meaning according to the order of the source text, save the original text, position and occurrence number, and combine the instruction units and their context to detect ambiguity of modification attachment, phrase combination ambiguity, parallel structure ambiguity, ellipsis structure ambiguity and new subject structure ambiguity; retain two interpretations with different syntactic structures that are reasonable in grammar and context for the same original text, and exclude differences caused only by word meaning, reference, lack of information or uncertain facts; count the number of confirmed ambiguous sentences of each type, determine the type with the most number as the main ambiguity type, and select all ambiguous sentences belonging to the main ambiguity type as target sentences when the number of sentences is the most numerous.

3. The method according to claim 1, characterized in that, Construct a collection of shared resources, including: Extract actions, entities, attributes, and relationships from the two interpretations of each target sentence; align common operations and entity identifiers between the two interpretations; compare operations, targets, conditions, parameters, order, and dependencies; and record differences that can change operation requirements. Generate distinguishing resources based on these differences to give the two interpretations different operation requirements, while retaining shared background resources required to perform the relevant operations. Merge and deduplicate the distinguishing resources and shared background resources corresponding to each target sentence to form a resource set shared by the original version and the two disambiguation versions. Provide the agent with the task, text context, and allowed operations, but do not provide interpretation comparison results, specified interpretations, or expected operation sequences.

4. The method according to claim 1, characterized in that, Each target sentence was rewritten using partial disambiguation techniques, including: Before executing the agent, fix the two interpretations and their direction numbers for each target sentence, clarify the first or second interpretation with minimal syntactic changes, and retain the corresponding interpretation's action, object, scope, condition, quantity, and order requirements; replace all target sentences with the rewrite corresponding to the first interpretation to obtain the first disambiguation version, and replace all target sentences with the rewrite corresponding to the second interpretation to obtain the second disambiguation version; verify the completeness of the target sentence replacement and the consistency of non-target text, and verify whether the rewrite conforms to the corresponding interpretation, eliminates target ambiguity, and does not introduce additional requirements; output failure or pending review status for cases where the interpretation is unreasonable, the rewrite adds requirements, or there are conflicts between fixed interpretations, and do not consider versions that fail the verification as valid disambiguation versions.

5. The method according to claim 1, characterized in that, To enable the agent to run repeatedly in a virtual software space under the original version, the first disambiguation version, and the second disambiguation version, including: An initial interaction history is constructed based on the current skill instruction version, shared task, and text context, and the currently running operation request record is initialized to empty. The large language model generates tool requests based on the interaction history. After verification by the request dispatcher, if it is a read request, the preset resource facts are returned based on the resource snapshot without changing the operation request record. If it is a valid action request, the operation in the tool request is appended and the record status and the updated operation request record are returned. The tool request and tool response are appended to the interaction history, and subsequent tool requests continue to be generated until the agent stops or the unified interaction round limit or tool call limit is reached.

6. The method according to claim 1, characterized in that, Repeated runs under the original version, the first disambiguation version, and the second disambiguation version also include: The original version, the first disambiguation version, and the second disambiguation version are all executed at least twice. Each version uses the same pre-determined set of random seeds and restores the same initial resources, initial interaction conditions, and no-operation request records before each run. The version identifier, random seed, model and running parameters, tool requests, tool responses, and termination status are recorded. The running records of the original version are used for comparison with the first disambiguation version and the second disambiguation version. For each comparison, the distance between each run of the original version and each run of the disambiguation version is calculated, not limited to the distance between runs corresponding to the same random seed.

7. The method according to claim 1, characterized in that, Extract the operation names from the records of each valid run in the order of invocation and retain duplicate invocations, including: Extract the operation name field from the action request in the complete and valid execution record, arrange the operation names in the order in which the requests occurred, without sorting or deduplication; represent the execution that ends normally without requesting any action as an empty sequence, and distinguish the execution failure or incomplete record from the empty sequence; use the operation name as the sequence element, calculate the edit distance by the minimum number of insertions, deletions and replacements required to transform one operation sequence into another operation sequence, and normalize the edit distance by the maximum value between the lengths of the two operation sequences and the value 1.

8. The method according to claim 7, characterized in that, Calculate the separation interval, including: The operation sequence of the original version is paired one by one with the operation sequence of the disambiguation version to form an inter-version distance set, and the minimum value of the inter-version distance set is taken; within the original version and the disambiguation version, the distance is calculated for operation sequences with different run numbers, and the distances are merged to obtain an intra-version distance set, and the maximum value of the intra-version distance set is taken; the minimum value of the inter-version distance set is subtracted from the maximum value of the intra-version distance set to obtain the separation interval corresponding to the disambiguation version; operation sequences with different run numbers are allowed to have the same content, and the zero distance corresponding to the same content is retained in the intra-version distance set.

9. The method according to claim 8, characterized in that, Output detection results, including: The detection results include the control status and change category. When the minimum value of the inter-version distance set is greater than the maximum value of the intra-version distance set, the corresponding control is marked as strictly separated. When the minimum value of the inter-version distance set is equal to zero, it is marked as having the same operation sequence across versions. When the minimum value of the inter-version distance set is greater than zero and not greater than the maximum value of the intra-version distance set, it is marked as operation sequences not overlapping but with insufficient separation interval. For operation sequence pairs in controls that meet the strict separation criteria, the operation name set, the number of calls for each operation, and the call order are compared in turn. Changes in the operation set, the number of calls for each operation, or the call order are recorded. When the operation sequence pair corresponding to the same skill instruction involves multiple change categories, it is recorded as a mixed change.

10. A system for detecting the impact of syntactic ambiguity in intelligent agent skill instructions, characterized in that, The system includes: The target sentence and resource construction module is used to acquire the skill instructions of the agent to be detected, identify the target sentence with two reasonable syntactic interpretations, structure the two interpretations and identify their operational differences, and construct a shared resource set, task, text context and allowed operations accordingly. The disambiguation version generation module is used to preserve the original version of the agent's skill instructions, fix the first and second interpretations of each target sentence, perform local disambiguation rewriting on each target sentence to obtain the first and second disambiguation versions, and keep the non-target text unchanged. The controlled execution module is used to construct a virtual software space based on a shared resource set, including resource snapshots, read interfaces, action interfaces, and request dispatchers. This allows agents to repeatedly run in the virtual software space under the same task, text context, allowed operations, tool response rules, and agent configuration, in the original version, the first disambiguation version, and the second disambiguation version. Before each run, the resource snapshot, interaction history, and operation request records are reset. The read interface returns the preset resource facts, and the action interface verifies and records the operation requests without executing real system actions. The operation sequence extraction module is used to extract operation names from the records of each valid run in the order of call and retain repeated calls to form operation sequences for each version; The separation interval determination module is used to determine the separation interval for a control consisting of the original version and each disambiguation version, provided that each version of the control has at least two valid runs. The separation interval is obtained by subtracting the maximum distance between different run operation sequences within each of the two versions of the control from the minimum distance between the operation sequences of different versions. When at least one separation interval is greater than zero, the detection result of strict separation and the corresponding operation sequence and separation interval are output.