feat(core): Add cross-reference extraction infrastructure

Introduces two new modules for extracting and storing entity cross-references
from GitLab data:

note_parser.rs:
- Parses system notes for "mentioned in" and "closed by" patterns
- Extracts cross-project references (group/project#42, group/project!123)
- Uses lazy-compiled regexes for performance
- Handles both issue (#) and MR (!) sigils
- Provides extract_refs_from_system_notes() for batch processing

references.rs:
- Extracts refs from resource_state_events table (API-sourced closes links)
- Provides insert_entity_reference() for storing discovered references
- Includes resolution helpers: resolve_issue_local_id, resolve_mr_local_id,
  resolve_project_path for converting iids to internal IDs
- Enables cross-project reference resolution

These modules power the entity_references table, enabling features like
"find all MRs that close this issue" and "find all issues mentioned in this MR".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-02-05 00:03:13 -05:00
parent 0b6b168043
commit f748570d4d
3 changed files with 1114 additions and 2 deletions

View File

@@ -1,5 +1,3 @@
//! Core infrastructure modules.
pub mod backoff;
pub mod config;
pub mod db;
@@ -9,9 +7,11 @@ pub mod events_db;
pub mod lock;
pub mod logging;
pub mod metrics;
pub mod note_parser;
pub mod paths;
pub mod payloads;
pub mod project;
pub mod references;
pub mod sync_run;
pub mod time;