Make zerolang agent-native verifiable#391
Open
September11111111111 wants to merge 1 commit into
Open
Conversation
|
@September11111111111 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
08d5735 to
ae6e292
Compare
Author
|
Confirmed. ae6e292 fixes this by making patch_replace_text duplicate the incoming value before freeing the destination slot, so it is safe when value aliases *slot. The addImport/addFunction explicit-node regression coverage is included as well.
…------------------ 原始邮件 ------------------
发件人: "vercel-labs/zerolang" ***@***.***>;
发送时间: 2026年6月8日(星期一) 凌晨1:43
***@***.***>;
***@***.******@***.***>;
主题: Re: [vercel-labs/zerolang] Make zerolang agent-native verifiable (PR #391)
@vercel[bot] commented on this pull request.
In native/zero-c/src/program_graph_patch_ops.c:
> } + ZProgramGraphNode *node = patch_append_node(graph); + node->id = z_strdup(node_id); + node->kind = Z_PROGRAM_GRAPH_NODE_IMPORT; + node->name = z_strdup(op->name); + node->value = z_strdup(alias); + node->path = z_strdup(parent->pah ? parent->path : ""); + node->line = 1; + node->column = 1; + ZProgramGraphEdge *edge = patch_append_edge(graph); + edge->from = z_strdup(parent->id); + edge->to = z_strdup(node_id); + edge->kind = z_strdup("import"); + edge->target = Z_PROGRAM_GRAPH_EDGE_TARGET_NODE; + edge->order = order; + patch_replace_text(&op->node, node_id);
Commit ae6e292 fixed the use-after-free by reordering patch_replace_text to copy the value with z_strdup into a temporary (char *copy) BEFORE calling free(*slot), then assigning *slot = copy. This makes the function safe even when value aliases *slot (the addImport/addFunction explicit-node case), since the source buffer is still valid at copy time. The aliasing guard from the original suggestion is no longer needed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds compiler-owned Agent protocol surfaces, checked graph edit/retry contracts, proof receipt policy, objective
completion audit, and README/Chinese README documentation.
Verified:
- native build passes
- agent-contracts-gate passes with no gate failures
- agent-completion-audit passes all 12 objective requirements