Fixed reingest routing and capture lifecycle normalization
- Day: 2026-06-24
- Time: 12:05 to 12:20
- Project: Dev
- Workspace: WP 2: Operational
- Status: In Progress
- Priority: HIGH
- Assignee: Matías Nehuen Iglesias
- Tags: Pipeline, Reingest, Normalization, Bugfix, Workflow, Capture-Lifecycle
Description
Session Goal
Debug and harden the capture/reingest pipeline so row-linked captures preserve target identity, actionable artifacts are routed correctly, and the UI/workflow uses the canonical lifecycle object as the source of truth.
Key Activities
- Diagnosed that transcription, routing, and artifactization were working, but
propose_reingestwas losingrow_snapshot/target.project_idcontext. - Identified a deterministic bug in
propose_reingest_event/_derive_eventwhere target identity could be dropped, and proposed enforcingtarget_idfromproject_id. - Reviewed
_normalize_payloadbehavior and foundtarget_surface == "none"could incorrectly override stronger signals fromproject_idand actionable capture data. - Proposed a two-layer fix: normalize the model output after generation and pass richer raw capture context into event derivation so row-linked captures remain tied to the correct target.
- Defined a simplified deterministic normalization path that derives
target_surface,target_id, and fallback delta fields from normalized capture data. - Documented batch repair /
--forcereprojection workflows to reprocess misrouted reingest candidates. - Noted a lifecycle invariant: when duplicate events exist, the compiler should select the latest
capture.reingest_candidate.createdevent. - Flagged a remaining classification issue where
support_context/support_context_noteartifacts should be human-reviewed and not auto-applied, but still routed into queue review. - Recommended splitting workflow surfaces into a candidate audit and an execution list, with the compiled lifecycle object as the source of truth.
- Specified that the canonical source for UI “next pointers” should be
capture_lifecycle.[[json]], combining row snapshot, routing, artifact candidate, reingest candidate, and approval state.
Achievements
- Clarified the root cause of reingest misrouting: missing row-linked context and weak normalization precedence.
- Established a deterministic repair strategy for target identity and payload normalization.
- Consolidated workflow guidance around a single lifecycle source of truth for review, repair, and UI rendering.
- Captured a concrete invariant for duplicate-event handling and a repair path for existing bad candidates.
Pending Tasks
- Implement the
_normalize_payloadprecedence fix soproject_idwins overtarget_surface == "none"when the capture is actionable. - Ensure
_derive_event/propose_reingest_eventreceive fullrow_snapshotand target context. - Verify
_find_capture()/_contextstructure so target and row snapshot are preserved end-to-end. - Reclassify support-context artifacts into queue review while keeping them human-reviewed.
- Update the UI mapping to read next-action cards from
capture_lifecycle.[[json]]rather than raw artifact candidates.
Evidence
- source_file=2026-06-24.sessions.jsonl, line_number=1, event_count=0, session_id=d31201988cac8e5b737cce0a9ccca06204e1afed8cc95b0a602b9fff3e0cac22
- event_ids: []