Skip to content

refactor: join lineage by request ID - #2452

Merged
hallerite merged 2 commits into
codex/rlm-lineagefrom
codex/lineage-request-correlation
Aug 27, 2026
Merged

refactor: join lineage by request ID#2452
hallerite merged 2 commits into
codex/rlm-lineagefrom
codex/lineage-request-correlation

Conversation

@hallerite

@hallerite hallerite commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

This is a focused follow-up stacked on #2449. It keeps that PR's optional ACP lineage manifest and simplifies only the model-call correlation transport:

  • store one opaque lineage_request_id on each ModelCall instead of copying session, context, compaction, transition, parent, and depth into a CallLineage envelope
  • consume and strip only X-ACP-Lineage-Request-ID at interception; Idempotency-Key remains independent and continues to the provider
  • join calls to LineageManifest.requests when ACP publishes its snapshot, with the manifest remaining the sole source of graph structure
  • derive calls_by_session, branches_by_session, and branch session/context/compaction IDs through that join without persisting duplicate graph data
  • preserve unchanged behavior for harnesses that publish no lineage extension
  • pin nano-RLM PR #152 at e26b37a0e8f06d64bff8d7a627ed261be41726a3

The resulting wire contract is:

  1. a harness assigns a stable logical request ID;
  2. its model request carries the private correlation header (and may independently use the same ID for idempotency);
  3. interception records that ID on the call and removes the private header upstream;
  4. the ACP manifest maps the ID to its session, context, compaction, and ancestry;
  5. verifiers validates and resolves the relationship when it receives the manifest.

Merge order

Merge nano-RLM #152 first, then update this PR's pin to the resulting commit on nano-RLM main before merging. This keeps the exact pin reachable even if #152 is squash-merged and its source branch is deleted.

Validation

  • uv run pytest tests/: 919 passed, 76 credential-gated tests skipped
  • focused trace/lineage suite: 8 passed
  • live Prime RLM ACP resume rollout passed and verifies every recorded call resolves through LineageManifest.requests plus calls_by_session
  • two live Prime SWE-bench Verified rollouts passed end to end with forced asyncio.gather recursion and a 1,000-token compaction threshold; each persisted 7 calls = 7 manifest requests, 3 sessions, 4 contexts, one completed compaction, overlapping child-call intervals, complete per-session grouping, and a successful JSON round trip
  • exact interception-handler regression covers correlated streaming with and without idempotency, private-header stripping, provider idempotency forwarding, and unchanged ordinary streaming rejection
  • ruff check/format, uv run ty check verifiers, touched-file pre-commit, and push hooks: passed

@hallerite
hallerite marked this pull request as ready for review August 27, 2026 14:36
@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 refactor changes ACP request handling, provider-facing idempotency headers, serialized trace records, and removes a public CallLineage API. It also updates the runtime dependency used by existing RLM rollouts, making the impact broader than a mechanical refactor.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

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

@hallerite
hallerite merged commit f62cee6 into codex/rlm-lineage Aug 27, 2026
5 checks passed
@hallerite
hallerite deleted the codex/lineage-request-correlation branch August 27, 2026 15:53
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.

1 participant