Skip to content

feat: project ContextProvenance explicitly - #34

Merged
ForeverAngry merged 1 commit into
mainfrom
feat/stabilized-context-provenance
Jun 1, 2026
Merged

feat: project ContextProvenance explicitly#34
ForeverAngry merged 1 commit into
mainfrom
feat/stabilized-context-provenance

Conversation

@ForeverAngry

Copy link
Copy Markdown
Owner

What

Modifies all projections (subgraph_to_context_item, memory_hit_to_context_item, evidence_to_context_item, security_finding_to_context_item, etc.) to pack their overlapping canonical fields into rig_compose::ContextProvenance directly via with_context_provenance, shifting non-canonical/domain-specific values (like internal ids, graphs, detail payloads) to with_metadata.

Why

This realizes the first half of the cross-crate coordination step Context & Provenance Wiring for rig-resources, aligning downstream projections cleanly into the stabilized ContextItem model.

Projects core fields into `ContextProvenance` and stores remaining source-specific fields in `ContextItem::metadata`, satisfying the downstream half of rig-compose's Context packing stabilization.
Copilot AI review requested due to automatic review settings June 1, 2026 20:53
@ForeverAngry
ForeverAngry merged commit 0a36761 into main Jun 1, 2026
16 checks passed
@ForeverAngry
ForeverAngry deleted the feat/stabilized-context-provenance branch June 1, 2026 20:54

Copilot AI 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.

Pull request overview

Refactors all rig-resources projections to populate rig_compose::ContextProvenance directly via with_context_provenance, moving canonical fields (source_uri, principal, scope, recorded_at_millis, confidence, projection_state, version_key, reason, source_frame_id) out of the free-form provenance JSON blob and into the typed provenance struct, while domain-specific fields (finding_id, severity, signals, seed, etc.) move to with_metadata. Tests are updated accordingly.

Changes:

  • src/projection.rs: switch BehaviorPattern, EntityBaseline, memory_hit_to_context_item, subgraph_to_context_item, and evidence_to_context_item to typed ContextProvenance + metadata split; drop local STATE_CANDIDATE/STATE_EXPANDED constants.
  • src/security/finding.rs: same split for security_finding_to_context_item; update doctest and unit tests; drop STATE_CANDIDATE.
  • tests/projection_provenance.rs: integration tests updated to read provenance via context_provenance() and domain fields via metadata.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/projection.rs Project canonical fields into ContextProvenance via builder; move domain fields to metadata.
src/security/finding.rs Same split for security findings; doctest and unit tests updated.
tests/projection_provenance.rs Helper and assertions rewritten to use context_provenance() and metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions Bot mentioned this pull request Jun 1, 2026
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.

3 participants