Skip to content

feat: add optional ACP semantic edges - #2449

Open
hallerite wants to merge 23 commits into
mainfrom
codex/rlm-lineage
Open

feat: add optional ACP semantic edges#2449
hallerite wants to merge 23 commits into
mainfrom
codex/rlm-lineage

Conversation

@hallerite

@hallerite hallerite commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds an optional, versioned ACP extension for semantic relationships between model requests, while leaving Verifiers' existing exact-prefix training graph unchanged.

  • accept cumulative SemanticEdgeSet payloads under ai.prime.acp/semantic-edges-v1
  • record harness-owned correlation IDs as ModelCall.acp.request_id
  • incrementally resolve new request-ID edges into typed MessageNode.semantic_parents
  • preserve arbitrary validated edge labels, so other ACP harnesses can add relationships without a Verifiers schema change
  • pin Nano-RLM main at verified merge commit 4a63696 from #153

This is one message-node DAG with physical and semantic parent links, not a separate lineage graph.

Data model

Concept Owner and meaning
Trace Verifiers-owned persisted rollout containing message nodes and intercepted model calls.
MessageNode.parent Verifiers-owned node index for the exact token-prefix parent used to reconstruct physical training branches.
MessageNode.semantic_parents Verifiers-owned list of typed ParentLinks. The list supports multiple parents, incremental append, and stable wire order.
ParentLink {node, type}, where node is a Verifiers-owned index into Trace.nodes.
Branch Root-to-leaf path derived only from physical parent links; not an agent or session identity.
ACPInfo.request_id Harness-owned request identifier advertised through ACP before inference; never a message-node index.

For example, a main-agent request that consumes two subagent results is stored directly on its committed node:

MessageNode(
    parent=physical_parent,
    semantic_parents=[
        ParentLink(node=5, type="subagent_return"),
        ParentLink(node=8, type="subagent_return"),
    ],
    ...,
)

The initial Nano-RLM vocabulary is:

previous request   --continuation-->    next request in the same agent
parent request     --subagent_call-->   child first request
child last request --subagent_return--> parent request consuming the result
summary request    --compaction-->      first request in the compacted context

These labels are conventions, not a closed enum. Unknown labels such as critic_review or namespaced relations such as vendor:review survive validation, application, serialization, and restoration.

Transport and incremental application

  1. The ACP harness assigns a stable request ID and includes X-ACP-Model-Request-ID on the model request.
  2. Interception removes that private header before provider forwarding and stores the ID as ModelCall.acp.request_id.
  3. The harness publishes its cumulative request-ID edge set in ACP response metadata.
  4. Trace.add_semantic_edges maps each newly advertised source and target request to its last committed sampled node, rejects duplicate or cyclic additions atomically, and appends a ParentLink to the target node.
  5. Repeated cumulative payloads are idempotent: existing semantic-parent lists and links remain in place rather than being rebuilt after every turn.
  6. WireTrace persists semantic parents beside the message nodes used by rollout viewers and trainers.

continuation preserves same-agent causality when retokenization, dropped reasoning, or another prompt rewrite breaks physical prefix reuse. A compaction edge replaces continuation for that transition.

Idempotency-Key remains independent and provider-facing. Harnesses that omit the header and ACP metadata behave exactly as before, with ModelCall.acp=None and semantic_parents=[].

Validation

  • Verifiers local suite: 922 passed, 76 credential-gated skipped
  • focused trace/interception suite: 21 passed
  • Nano-RLM suite at the pinned commit: 146 passed
  • Ruff, formatting, Ty, commit hooks, and push hooks pass
  • incremental tests cover cumulative replay without list replacement and atomic rejection of a physical + semantic cycle
  • CI passes on Python 3.11, 3.12, and 3.13, including the credentialed V1 live E2E
  • three Prime/SWE-bench Verified rollouts exercised concurrent subagents, subagent calls/returns, compaction, and WireTrace round-trips on the request-edge wire format

@hallerite hallerite changed the title feat: record recursive RLM lineage feat: add optional ACP lineage provenance Aug 27, 2026
@hallerite
hallerite marked this pull request as ready for review August 27, 2026 01:59
Comment thread verifiers/v1/interception/server.py Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This change adds a new ACP semantic-edge protocol and serialized trace-graph surface, wiring request headers, retry resolution, cycle validation, and close-time metadata through interception and harness execution. It also changes the default RLM pin/install cache and provider idempotency-header handling, giving the PR a broader runtime and compatibility impact than a small isolated option.

You can add or adjust custom eligibility rules. Learn more.

Comment thread verifiers/v1/interception/server.py Outdated
Comment thread verifiers/v1/harnesses/rlm/harness.py Outdated
Comment thread verifiers/v1/trace.py Outdated
Comment thread verifiers/v1/trace.py Outdated
Comment thread verifiers/v1/semantic.py Outdated
Comment thread verifiers/v1/trace.py Outdated
Comment thread verifiers/v1/trace.py Outdated
@hallerite hallerite changed the title feat: add optional ACP lineage provenance feat: add optional ACP semantic edges Aug 27, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4bf8f0b. Configure here.

Comment thread verifiers/v1/harnesses/rlm/harness.py Outdated

@mikasenghaas mikasenghaas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread verifiers/v1/trace.py Outdated
Comment thread verifiers/v1/trace.py Outdated
Comment thread verifiers/v1/trace.py Outdated
Comment thread verifiers/v1/trace.py Outdated
Comment thread verifiers/v1/semantic.py Outdated
Comment thread verifiers/v1/semantic.py Outdated
Comment thread verifiers/v1/graph.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants