feat: add optional ACP semantic edges - #2449
Conversation
3687c7f to
34e9387
Compare
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a substantial ACP semantic-edge capability across interception, trace serialization, ACP session lifecycle, and the RLM runtime, including a new default dependency pin. The extension is optional and additive for ordinary requests, but its cross-cutting changes to shared production paths warrant human review. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
mikasenghaas
left a comment
There was a problem hiding this comment.
nice this looks quite clean indeed. i think one thing we need to make super clear in the api itself is that the difference between
- vf-owned message node linking (rn we have a list of nodes and use indices to point ot parents and link model calls to nodes)
- harness-owned (via acp) linking, rn via
request_id
it shoud be ultra clear which ids/indices come from vf and which are advertised by the harness
8f77bfa to
ac7b5dc
Compare
aecca05 to
ce54823
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ce54823. Configure here.
6b0b33e to
a0dc9c8
Compare

Summary
Adds an optional, versioned ACP extension for typed semantic relationships between model requests while leaving Verifiers' physical training branches unchanged.
SemanticEdgeSetpayloads underai.prime.acp/semantic-edges-v1ModelCall.acp.request_idMessageNode.semantic_parents4a63696This remains one message-node DAG with physical and semantic parent links, not a second lineage graph. The unrelated concurrent physical-graph race is handled separately in #2477.
Data model
MessageNode.parentMessageNode.semantic_parentsParentLink{node, type}, wherenodeis an index intoTrace.nodes.BranchACPInfo.request_idFor example, a parent request consuming two child results is represented directly on its message node:
nano-RLM initially uses
continuation,subagent_call,subagent_return, andcompaction. These are conventions rather than a closed enum; other validated labels and namespaced relationships are preserved.Transport
X-ACP-Model-Request-IDon the corresponding model request.ModelCall.acp.request_idand removes both the private correlation header and its locally ownedIdempotency-Keybefore provider forwarding.Trace.add_semantic_edgesresolves committed source and target requests, validates the additions atomically, and appendsParentLinks to the target nodes.WireTracepersists the resolved links with the rollout.Harnesses that omit the header and extension metadata behave exactly as before:
ModelCall.acp=Noneandsemantic_parents=[].Validation
Note
Medium Risk
Touches interception (headers, idempotency/streaming), trace serialization, and ACP shutdown; behavior is backward-compatible when harnesses omit the extension, but edge resolution errors or mis-correlated request IDs could fail rollouts.
Overview
Adds an optional ACP extension so harnesses can declare typed relationships between logical model requests without changing how physical training branches are built from
MessageNode.parent.Harnesses can send
X-ACP-Model-Request-IDon intercepted calls; the server stores it onModelCall.acpand strips private ACP headers before the provider. Cumulative edge payloads underai.prime.acp/semantic-edges-v1are applied on ACP turns and onsession/closeviaTrace.add_semantic_edges, which maps request IDs to sampled nodes and appendsMessageNode.semantic_parents(ParentLinkwith extensible edge types). Validation rejects duplicates, self-edges, and cycles; SDK retries sharing one request ID resolve to the last committed node.RLM is bumped to a nano-rlm commit that emits these edges, with version-scoped install caches and session metrics also consumable from close metadata. E2E checks for RLM now assert every call has ACP info and semantic parent links point at sampled nodes.
aiohttpis pinned to >=3.14.1.Reviewed by Cursor Bugbot for commit a0dc9c8. Bugbot is set up for automated code reviews on this repo. Configure here.