Multi-agent collaborative writing governance method and system
By generating digitally signed authorized transactions in the trust domain and isolating writes, calculating precise sets and verifying self-certification, the detection problem during parallel modifications by multiple agents is solved, and the recomputable detection and secure merging of versioned objects are realized.
Patent Information
- Application Number
- CN202611317863.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-17
AI Technical Summary
When multiple agents modify versioned objects in parallel, existing technologies struggle to simultaneously detect omissions, unauthorized actions, conflicts between different contents on the same path, and candidate tree injection that bypasses the proposal queue. Furthermore, they cannot prevent the reuse of old audits after candidate tree changes, and the validator's critical assertions may fail.
A trust domain is set up outside the writable execution domain of the intelligent agent to generate authorized transactions with digital signatures. An isolated work area is established through a collaborative orchestrator, a candidate tree is constructed and an exact set is calculated. The recalculability is determined by combining the audit service and the verifier self-certification service to ensure that authorization, indifference and assertion validity are satisfied before merging.
It implements recalculable deterministic detection of concurrent changes by multiple agents, prevents the reuse of old audits, reduces the error release of silent validators, and ensures the accuracy and security of versioned object writing.
Smart Images

Figure CN123114532A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer software change governance, distributed agent collaboration, versioned object storage, access control, and software testing. Specifically, it relates to a method and system for binding authorization boundaries, isolation proposals of multiple agents, actual candidate trees, audit evidence, and verifier self-verification results into the same transaction, and controlling the writing or merging of versioned objects in a failure-closed manner. Background Technology
[0002] In version control systems, content-addressed object stores, or data systems with immutable snapshots, multiple agents can generate fact nodes, rule files, code, or other protected objects in parallel based on the same baseline. Common approaches allow multiple agents to write directly to a shared working tree, or to perform path whitelisting, building, and testing only before the final commit.
[0003] Path whitelists typically only identify changes outside the authorized scope; they cannot prove that every mandatory object within the authorized scope has been changed, nor can they prove that the actual candidate tree has not bypassed the additional writing of the proposal record. When only agent operation logs are recorded, the log content may deviate from the candidate tree objects; when multiple agents generate different objects for the same path, simple path set deduplication may also mask content conflicts.
[0004] Existing pre-commit validation typically associates test results with task, branch, or pipeline run number. When the branch name remains the same but the candidate tree object changes, old test results may continue to be used. The validation process itself may also lose its detection capabilities due to the removal of critical assertions, the swallowing of exceptions, or the generalization of error flags.
[0005] US20110296386A1 discloses remote building and testing before source code change submission; US10438118B2 discloses metamorphic testing of applications utilizing artificial intelligence; US12450494B1 discloses a method where an artificial intelligence model compares the proposed actions of an autonomous agent with the expected actions and modifies the proposed actions accordingly. The above schemes do not provide the following combination: a precise authorization set is provided by the signature transaction; the joint change set of the proposal is verified separately from the actual candidate tree difference set; changes in the candidate tree invalidate the audit; and the precise mutation result of the validator's key assertion is used as the integration gate condition. Summary of the Invention
[0006] The technical problems to be solved by this invention are: how to simultaneously detect omissions, unauthorized actions, conflicts of different content on the same path, and candidate tree injection that bypasses the proposal queue when multiple agents modify versioned objects in parallel, using a recomputable computer data structure; how to prevent the reuse of old audits after the candidate tree changes; and how to verify that the key assertions of the governance validator are still valid before merging.
[0007] To address the aforementioned technical problems, this invention establishes a trust domain outside the writable execution domain of the intelligent agent. The authorization transaction service of the trust domain generates a digitally signed authorization transaction U, which includes at least a baseline tree object identifier, a set of approved intelligent agent identities, a set of approved action types, a set of precise authorization paths E, a validity period, and a replay prevention random number.
[0008] The collaborative orchestrator uses the baseline tree object as its common parent object to establish isolated working areas for approved agents. Each agent only generates a proposal record Pᵢ and does not directly write it into the shared candidate tree. After verifying the proposal records, the candidate tree constructor constructs the candidate tree C in a predetermined order.
[0009] For the i-th agent, a set of changed paths Dᵢ is formed, and a joint set of changed paths D=∪Dᵢ is formed. Without relying on the proposal record Pᵢ, the actual tree difference set R is calculated from the baseline tree B and the candidate tree C. The missing set M=E\D, the overstepping set X=D\E, and the set of conflicting content on the same path K are calculated; the exact set verification passes only when M, X, and K are all empty and D=R=E.
[0010] The audit service generates audit record A, which includes a summary of the bound authorization transaction, a candidate tree object identifier, and a validator summary. The integration executor reads the current candidate tree object identifier each time it makes a decision; if the current candidate tree object identifier differs from the candidate tree object identifier in audit record A, audit record A is set to invalid, and the old gate token is rejected.
[0011] The assertion registry G stores the target error code, fault fixture, mutation operator, expected exit status, and expected error flag for each critical verification assertion. The verifier self-verification service generates minimal variants one by one in an isolated copy; self-verification passes only if each critical variant causes the verifier to produce a predetermined non-zero exit status and assertion-specific error flag.
[0012] Only when the authorized transaction is valid, M, X, and K are empty, D=R=E, the audit log is not invalid, and the critical assertion self-verification passes, does the trust domain issue a one-time integration gate token bound to the candidate tree object identifier. The integration executor registers a replay-protected random number after consuming the token.
[0013] If the exact sets E\D and D\E are not calculated, omissions within the authorized scope or unauthorized actions outside the authorized scope cannot be identified simultaneously; if R, which does not depend on the proposal record, is not calculated, changes written to the candidate tree by bypassing the proposal queue cannot be identified; if K is not constructed, concurrent heterogeneous results on the same path may be masked by path deduplication; if the audit is not bound to the candidate tree object, the old audit may remain valid after the candidate tree changes; if assertion self-verification of specific mutations is not performed, the validator may still be erroneously allowed even after the key assertion is removed.
[0014] This invention transforms concurrent changes by multiple agents from probabilistic or log-based judgments into recalculable deterministic judgments through isolated writing, precise set operations, candidate tree object anchoring, and failure shutdown gating; it detects inconsistencies between proposal records and actual candidate trees using D=R=E; it prevents the reuse of old evidence through audit failure linkage; and it reduces erroneous releases caused by silent failures of the verifier by asserting self-verification of specific mutations. Attached Figure Description
[0015] Figure 1 A schematic diagram of the structure of a governance system for multi-agent collaboration.
[0016] Figure 2 A flowchart for writing governance methods for multi-agent collaboration.
[0017] Figure 3 Bind the failure state machine diagram for auditing the candidate tree.
[0018] Figure 4 This is a flowchart of a validator mutation self-verification based on an assertion registry. Detailed Implementation
[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments. The following embodiments are used to illustrate the technical solutions of the present invention and are not intended to limit the scope of protection.
[0020] like Figure 1 As shown, the governance system 100 includes a trust domain 110, a collaborative orchestrator 120, agent isolation workspaces 131, 132, and 133, a proposal queue 140, a candidate tree constructor 150, a precise set verifier 160, a verifier self-certification service 170, and an integration executor 180. The trust domain 110 includes an authorization service 111, an assertion registry 112, and an audit service 113. The agent workspace does not have write permissions to the authorization service 111, the assertion registry 112, the audit service 113, or the integration executor 180.
[0021] Protected objects can be stored in a Git tree, a Merkle directed acyclic graph, a database snapshot with content-addressable object identifiers, an object store inventory, or an immutable artifact repository. Baseline tree B and candidate tree C represent the object set and object identifier mapping before and after the change, respectively.
[0022] Authorization transaction U uses normalized serialization. An example set of fields is: authority_id, schema_version, baseline_tree, agents[], actions[], authorized_paths[], expected_artifacts[], issued_at, expires_at, nonce, signer_id, and signature. The signature input does not include the signature field and includes a prefix separating the object type and schema version fields.
[0023] The path normalization function N(p) unifies the path separator, rejects absolute paths, empty paths, and parent-bounded segments, normalizes according to predefined Unicode rules, and generates unique keys according to the version control's case rules. For symbolic links, it also verifies that their resolution results do not exceed the authorized root directory. The authorized path set E is obtained by sorting and deduplicating the results of N(p).
[0024] A proposal record Pᵢ includes at least proposal_id, agent_id, base_tree, operations[], created_at, and proposal_digest. Each operation includes action, path, before_oid, after_oid, and content_sha256. For deletion operations, action is set to delete, after_oid is empty, and an explicit tombstone record is generated; at most one tombstone record exists for the same path in the same candidate tree, and the path cannot simultaneously have non-deletion proposals.
[0025] For text objects, a raw byte content digest (raw_digest) and a logical content digest (logical_digest) normalized from CRLF or CR to LF are calculated according to the line break rules associated with the path. Both digests are written to the proposal record. When comparing two text objects corresponding to the same path, if the equality determination of raw_digest and logical_digest is inconsistent, a normalization conflict E_NORMALIZATION_CONFLICT is generated and issuance is blocked.
[0026] like Figure 2 As shown, in step S201, the authorization service 111 issues an authorization transaction U; in step S202, the collaborative orchestrator 120 establishes an isolated work area based on the same baseline tree B; in step S203, the proposal queue 140 receives proposal records, and the candidate tree builder 150 constructs a candidate tree C according to the normalized path and the proposal summary.
[0027] In step S204, the precise set validator 160 forms Dᵢ and D=∪Dᵢ from the valid proposal records, and calculates R={p|oid_B(p)≠oid_C(p)} by comparing the object identifiers corresponding to each normalized path in the baseline tree B and the candidate tree C. The calculation of R does not read the proposal records.
[0028] In step S205, calculate M=E\D and X=D\E, and create a result_map[p]={(agent_id,action, after_oid, content_sha256)} for each path. When the same path has different after_oids, different content_sha256s, or combinations of delete and non-delete, add the path to K. Duplicate proposals with the same action, the same after_oid, and the same content_sha256 are treated as idempotent proposals.
[0029] In step S206, an exact set validation pass result is generated only when M, X, and K are empty and D=R=E. The validation output includes at least missing_paths, unauthorized_paths, conflict_paths, proposal_only_paths, and tree_only_paths, so that each type of failure has an independent machine label. Audit service 113 writes the validation result, authority_digest, candidate_tree, verifier_digest, mutation_summary, and lineage_root to audit log A.
[0030] like Figure 3 As shown, the candidate tree is in candidate state 301. After verification and generating an audit record, it enters audited state 302. After self-verification via a key assertion, it enters self-verified state 303. After issuing a gate token, it enters integrable state 304. If the current_tree in audited state 302, self-verified state 303, or integrable state 304 differs from the candidate_tree in the audit record, the state transitions to invalid state 305, the old gate token is cleared or rejected, and the process returns to candidate state 301 for re-verification.
[0031] like Figure 4As shown, in step S401, the assertion registry G is read; in step S402, a minimal variant that only violates the target condition of a key assertion is generated; in step S403, the verifier is executed in an isolated copy of the read-only candidate tree; in step S404, the actual exit state and the expected exit state, as well as the actual error flag and the expected error flag, are compared simultaneously. If both match, it is recorded as a precise kill in step S405; if there are no failures, flag mismatches, timeouts, or infrastructure anomalies, integration is blocked in step S406.
[0032] Examples of registry assertions include: A01 Unauthorized Path Assertion, corresponding to E_UNAUTHORIZED_PATH; A02 Missing Path Assertion, corresponding to E_AUTHORIZED_PATH_MISSING; A03 Same Path Different Content Assertion, corresponding to E_CONFLICT; A04 Audit Failure Assertion, corresponding to E_STALE_AUDIT; A05 Authorization Signature Assertion, corresponding to E_AUTHORITY_SIGNATURE; A06 Baseline Anchor Assertion, corresponding to E_BASELINE_ANCHOR; A07 Candidate Tree Difference Assertion, corresponding to E_CANDIDATE_DIFF; A08 Self-Verified Integrity Assertion, corresponding to E_VERIFIER_SELFTEST.
[0033] The system generates the following lineage edges: authorized transactions to proposal records (authorizes edge), agents to proposal records (produces edge), proposal records to modified objects (creates or deletes edge), modified objects to candidate trees (included_in edge), candidate trees to audit records (audited_as edge), and audit records to gate tokens (authorizes_integration edge). Merkle roots are calculated in stable order and written to audit records.
[0034] A one-time integration gate token includes at least candidate_tree, authority_digest, audit_digest, expires_at, nonce, and signature. The integration executor 180 recalculates current_tree and verifies the signature, expiration date, and nonce before consumption; after consumption, it registers the nonce to prevent the same token from being replayed on another candidate tree or in subsequent transactions. Fault detection
[0035] In the aforementioned faults, the omitted set direction within the authorized scope is E\D, and the unauthorized set direction outside the authorized scope is D\E. Since D=E alone cannot prove that the actual candidate tree conforms to the authorization, R=E is also required, and D=R must also be verified. Example 2: Isolated Synthetic Reference Standard
[0036] In the isolated synthetic baseline, the baseline contains 160 paths, of which 120 are precisely authorized; eight agents are used to construct eight types of single-fault test cases. Each configuration also runs 30 fault-free test cases and executes 500 I / O-free check cycles. The script's SHA-256 is 333a2b053620c733a6c4616770921f0a3e7532c452e3b3af211b221667b08bbe; the interpreter is Python 3.12.13, and the kernel is Linux 6.18.35.
[0037] Configuration A only detects same-path conflicts in the repository; Configuration B adds a path-allowed list; Configuration C adds precise set, authorization signature, baseline anchor, and actual candidate tree differences; Configuration D adds candidate tree audit failure linkage and validator self-verification. The detection results are shown in the table below.
[0038] The complete closed-loop test achieved a 100.0% detection rate for all eight types of single faults, with zero false alarms across 30 fault-free test cases in four configurations. In the assertion removal simulation, all eight target error flags were identified as missing after the corresponding assertions were removed (i.e., eight were identified and zero were not). This script simulates assertion-specific flags using structured error codes returned by functions and does not initiate a separate validator process; therefore, the data in the table is not used to demonstrate end-to-end process exit codes or production deployment performance.
[0039] The latency data only reflects comparisons of in-memory sets, summaries, and audit fields, and does not include repository checkouts, network signatures, disk hashes, agent inference, or production I / O. It cannot be extrapolated to end-to-end production latency. Optional implementation methods
[0040] In one alternative implementation, candidate objects and effective objects are stored in different directories and use different file formats; the input paths of the assembly pipeline use a constant enumeration that does not include the candidate object directory. A candidate object is converted to an effective state only when there is a machine-verifiable signature record and the signature count equals the number of promoted objects. This isolation can be used in conjunction with the aforementioned one-time integration gate.
[0041] In another alternative implementation, the protected object comprises a machine-readable fact block defined by a predetermined marker. The verifier parses the fact block into a set of key-value pairs, normalizes the format of the corresponding representations in the referenced documents, and calculates a set of inconsistent key names; a gate token is blocked when the set of inconsistent key names is not empty. This content constraint serves as an additional check after the exact set check and does not replace the path-level checks of E, D, and R.
[0042] Authorized signatures can employ asymmetric digital signatures, hardware security modules, or keys within a trusted execution environment. The synthesis benchmark uses HMAC solely for process verification and is not limited to any particular signature implementation. The exact authorized set E can also be expanded using a deterministic selector within the signature transaction, but the expansion result must have its digest fixed at issuance and recalculated during verification. Example 3: Data Structure Constraints
[0043] All of the following data objects contain schema_version. The validator terminates with a failure and closes when it encounters an unknown version, a missing required field, a duplicate path key, a mismatched digest length, or an unrecognized action type, without applying implicit default values to missing fields.
Claims
1. A multi-agent collaborative write governance method, characterized in that, The following steps are performed by at least one processor: obtaining a digitally signed authorization transaction from a trust domain isolated from the writable execution domains of multiple agents, the authorization transaction including at least a baseline tree object identifier, a set of approved agent identities, a set of approved action types, a set of precise authorization paths E, an expiration period, and a replay-protected random number; Using the baseline tree object identifier as a common parent object, mutually isolated work areas are established for each authorized agent. Proposal records generated by each agent are received. These proposal records include the agent's identity, the baseline tree object identifier, and the correspondence between path, action, object identifier before change, object identifier after change, and content summary. Agents are prohibited from directly writing to the shared candidate tree. A candidate tree is constructed based on the proposal records, forming a set of change paths Dᵢ for each agent and a joint set of change paths D=∪Dᵢ. The actual tree difference set R is calculated from the baseline tree and the candidate tree without relying on the proposal records. Calculate the missing set E\D and the unauthorized set D\E, and compare the modified object identifiers or content summaries for the intersection paths of multiple Dᵢ to form a conflict set K of different content along the same path. Generate a passing result for exact set verification when E\D, D\E, and K are all empty and D=R=E. Generate an audit record that is at least bound to the authorized transaction summary, the candidate tree object identifier, and the validator summary, and set the audit record to an invalid state when the current candidate tree object identifier is different from the candidate tree object identifier in the audit record. Apply minimum mutation to multiple key verification assertions in a copy isolated from the candidate tree according to the assertion registry, and generate a validator self-certification passing result only when each key mutation produces a predetermined non-zero exit state and a predetermined error flag corresponding to the target assertion. And issue a one-time integration gate token bound to the candidate tree object identifier only when the authorized transaction is valid, the exact set verification passes, the audit record is not invalid, and the validator self-certification passes.
2. The method according to claim 1, characterized in that, The authorized path and the proposal path are subjected to path normalization processing, which includes at least unifying the path separator, rejecting absolute paths and parent out-of-bounds segments, normalizing according to the predetermined Unicode rules, generating unique keys according to the version control case rules, and verifying that the symbolic link resolution results do not exceed the authorized root directory.
3. The method according to claim 1, characterized in that, The set K of conflicting content along the same path includes: paths with at least two different modified object identifiers, paths with at least two different content summaries, and paths with both deletion and non-deletion actions. Deletion actions are represented by tombstone records, and there is at most one tombstone record for the same path in the same candidate tree. When multiple agents give the same action, the same modified object identifier, and the same content summary for the same path, it is identified as an idempotent duplicate proposal.
4. The method according to claim 1, characterized in that, The authorized transaction is serialized using a normalized serialization method that employs field sorting, fixed character encoding, and fixed null value representation, and a field separator prefix for object type and mode version is added to the summary input; the trust field registers anti-replay random numbers when issuing and consuming the one-time integrated gate token.
5. The method according to claim 1, characterized in that, For text-based protected objects, the original byte content digest and the logical content digest after line break normalization are calculated according to the line break rules associated with the object path, and both digests are written into the proposal record. When comparing two text objects corresponding to the same path, if the equality determination of the original byte content digest is inconsistent with the equality determination of the logical content digest, a normalization conflict is output and the issuance of a one-time integration gate token is blocked.
6. The method according to claim 1, characterized in that, Generate a lineage edge from authorized transactions, agents, proposal records, modified objects, candidate trees, audit records to one-time integration gate tokens, calculate the Merkle root of the lineage edge in a stable order, and write the Merkle root into the audit record.
7. The method according to claim 1, characterized in that, Each critical assertion in the assertion registry includes at least an assertion identifier, a target error code, a fault fixture identifier, a mutation operator, an expected exit status, and an expected error flag; failure, error flag mismatch, runtime timeout, or infrastructure anomaly are all determined to be due to the corresponding critical mutation not being accurately killed.
8. A multi-agent collaborative write governance system, characterized in that, include: Authorization transaction service, located outside the writable execution domain of multiple agents, is used to generate authorized transactions that are digitally signed and include at least the baseline tree object identifier and the exact set of authorization paths E; A collaborative orchestrator is used to establish mutually isolated agent workspaces with the baseline tree object identifier as a common parent object and to receive proposal records; A candidate tree constructor is used to construct a candidate tree based on the proposal record; A precise set validator is used to form a joint change path set D for proposals, calculate the actual tree difference set R without relying on the proposal record, calculate E\D, D\E, and the set K of conflicts with different content on the same path, and verify that D=R=E; an audit service is used to generate audit records bound to the candidate tree object identifier, and invalidate the audit records when the candidate tree object identifier changes; a validator self-verification service is used to generate and execute the minimum variation of key assertions in an isolated copy based on the assertion registry, and compare a predetermined non-zero exit state with an assertion-specific error flag; And an integrated executor for consuming a one-time integrated gate token bound to the candidate tree object identifier only when the authorized transaction, exact set validation, audit validity, and validator self-certification all pass.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the method of any one of claims 1 to 7.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Verification by metamorphic testing of applications that utilize artificial intelligence
US10438118B2
Validating autonomous artificial intelligence (AI) agents using generative AI
US12450494B1
Methods and Systems for Validating Changes Submitted to a Source Control System
US20110296386A1
