wenjin272 opened a new issue, #1192: URL: https://github.com/apache/flink-agents/issues/1192
### Search before asking - [x] I searched existing issues for duplicates; related work is linked below where applicable. ### Description This is a child issue of #1055. #### Problem Event identity and lineage are framework metadata, but callers can populate `upstreamEventId`/`upstreamActionName` (Python: `upstream_event_id`/`upstream_action_name`) before emission. `ActionTask.finalizeOutputEvents` currently overwrites existing lineage, including during replay. Silent replacement obscures the public contract and lets invalid user declarations pass the send boundary. Python Event IDs are immutable, but assignment errors only provide the generic frozen-field diagnostic rather than guidance for reconstructing an Event with an existing identity. #### Proposed direction - Validate user-originated emission in Java/Python `sendEvent`/`send_event` and reject prepopulated framework-owned lineage with an actionable error. User business metadata belongs in `attributes`. - Preserve the existing output-versus-trigger identity invariant and align its behavior across native and cross-language paths. - Keep legitimate deserialization, replay, and typed reconstruction able to preserve identity and lineage. Distinguish these internal paths from a new user emission; do not apply a blanket rejection to restored framework events. - For Python immutable-ID assignment, explain when to use `reconstruct_from(event)` instead of only reporting `Field is frozen`. #### Acceptance criteria - Preset lineage fails clearly at user emission instead of being silently overwritten; valid emissions receive correct framework lineage. - Java/Python and cross-language tests cover normal emission, invalid identity/lineage, typed reconstruction, and recovery/replay. - Documentation distinguishes framework identity/lineage, user attributes, and reconstruction. Related: #1125 covers built-in event restoration; this issue covers ownership and validation at emission. Relevant code: Java/Python `Event`, RunnerContext implementations, and `runtime/.../operator/ActionTask.java`. ### Are you willing to submit a PR? - [ ] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
