Skip to content

Implement Redis-based data ingestion service with event handlers and Synapse integration#153

Open
Patrik-Corri wants to merge 21 commits intodevfrom
patrik_corri-dev
Open

Implement Redis-based data ingestion service with event handlers and Synapse integration#153
Patrik-Corri wants to merge 21 commits intodevfrom
patrik_corri-dev

Conversation

@Patrik-Corri
Copy link
Copy Markdown
Member

@Patrik-Corri Patrik-Corri commented Mar 20, 2026

IMPORTANT:

  • PR must be opened from your personal branch → dev
  • You must tag @Team-Deepiri/support-team
  • You must update Plaky to "Needs QA"
  • Never move a task to "Done" (Done = production release only)

Description

Briefly explain what this PR does and why.

Include:

  • Related Issue number
  • Data Ingestion Service Integration - Integrate with API Gateway and Synapse
  • Data Ingestion Service, API Gateway, Synapse, Database , Object Storage, Auth/User Context
  • Integration

Changes

  • Added StreamConsumerService to consume events from the platform-events Redis Stream using consumer group language--intelligence-consumers
  • Added streamRegistry.ts to register event handlers on startup, decoupling handler registration from the consumer loop
  • Added leaseEventHandler.ts, contractEventHandler.ts, and obligationEventHandler.ts to handle incoming stream events and update Prisma records accordingly

Related

  • Issue:
  • Plaky:
  • Related PRs (optional):

Testing

  • Start the stack and exec into the Redis container
  • Test - XADD platform-events * event lease-created timestamp 2026-03-20T00:00:00.000Z source test service test data "{"leaseId":"550e8400-e29b-41d4-a716-446655440000","leaseNumber":"L-001"}"
  • Check language intelligence logs: docker logs --tail 20 deepiri-language-intelligence-service-dev
  • Expected: [LeaseEventHandler] lease-created received { leaseId: '550e8400-e29b-41d4-a716-446655440000' }

Important Notes (Optional)

  • Known limitations:
  • Blockers:
  • CI/CD issues unrelated to this PR:
  • Dependencies required for testing:

Workflow Checklist (Required)

  • Branch is up to date with dev
  • PR is from your branch → dev (no longer directly into main)
  • PR title follows convention (feat:, fix:, refactor:, etc.)
  • Plaky feature/bug name included above
  • Tagged @Team-Deepiri/support-team
  • Plaky task moved to "Needs QA"

Review Requests

@Team-Deepiri/support-team


# SINGLE atomic install
RUN npm config set fetch-retries 5 \
&& npm config set fetch-retry-mintimeout 20000 \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these taken out for each service in the Dockerfiles?

RUN chmod +x /usr/local/bin/load-k8s-env.sh /usr/local/bin/docker-entrypoint.sh
COPY --chown=root:root platform-services/shared/scripts/load-k8s-env.sh /usr/local/bin/load-k8s-env.sh
COPY --chown=root:root platform-services/shared/scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN sed -i 's/\r$//' /usr/local/bin/load-k8s-env.sh /usr/local/bin/docker-entrypoint.sh && \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you having linux build issues?

"agi-decisions",
"training-events"
"training-events",
"ingestion-events",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you just set up the channel, but how does this ingest data?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I see are dockerfile edits, small changes to references and the streaming client for the shared utils, which then is imported by the lang intelligence service which then creates client subscriptions to the channels, ensure that they match up.

@thatsnotrlght you need to be making some progress on the Redis stuff by now in order for @Patrik-Corri to start receiving data

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any dockerfile edits are because i cannot build the containers without those changes, so ignore those. The data ingestion files are all located in the language-intellegence-service submodule.
a98efcf

Every other file change can be ignored as they are only to help me build the docker containers.
You said i have to create a PR for both the submodule and platform correct?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it that you are not able to build the containers? Do not put the sed command into the Dockerfile, you need to restore those changes and manually run the sed command on those files, then commit that state of the files. That will resolve the issues for everyone taking out those invisible windows chars, as well as it won't edit the Dockerfile. 2 birds with 1 stone.

You need to create a PR for both the submodule changes and the platform's submodule pointer as well as any platform file changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@austinm2h35-sketch
Copy link
Copy Markdown
Contributor

@SeanSan06 Going to assign this one to you this week, there's another PR in language-intelligence-service related to it (#23). Plaky task associated with this is titled "Data Ingestion Service Integration - Integrate with API Gateway and Synapse", be sure to assign yourself as the engineer there and post your review comment on the task as well. If you need any help, let me know!

@jrb00013
Copy link
Copy Markdown
Member

@SeanSan06 @austinm2h35-sketch is busy helping me this week, give this to someone else. We had 3 more QAs join, we need to get them going and utilize them. Todd and Jeremy Chaves need help. @Todd838 @JC5467

@austinm2h35-sketch
Copy link
Copy Markdown
Contributor

@jrb00013 Gotcha, thanks for the heads up! @JC5467 let this be your debut, see my comment above for procedural instruction. If you need help, let me know!

…ckerfiles

Normalize load-k8s-env.sh, docker-entrypoint.sh, prisma-baseline.sh (and ops/k8s copies) to Unix LF.

Drop RUN sed CRLF fixes from service Dockerfiles; chmod-only after COPY.

Add .gitattributes eol=lf for shared/scripts and ops/k8s *.sh.

Made-with: Cursor
@jrb00013
Copy link
Copy Markdown
Member

@thatsnotrlght and you are working together on this right

@austinm2h35-sketch
Copy link
Copy Markdown
Contributor

@JC5467 Checking in on this, if you're stuck just reach out and I'll get you some help

@jrb00013 jrb00013 changed the title Data Ingestion Service Implement Redis-based data ingestion service with event handlers and Synapse integration Apr 1, 2026
@austinm2h35-sketch
Copy link
Copy Markdown
Contributor

@Yoloholoknow I'm going to have you take over this testing, if you could. I'll tag you in the related one as well. If you need help just let me know. Thanks!

@Yoloholoknow
Copy link
Copy Markdown
Member

@Patrik-Corri please resolve the conflicts before me and the team start reviewing and testing

@jrb00013
Copy link
Copy Markdown
Member

jrb00013 commented Apr 7, 2026

@Patrik-Corri use ai-conflict.py brother

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.

4 participants