Skip to content

feat: add pdf ingestion lane - #16

Merged
POWERFULMOVES merged 1 commit into
mainfrom
codex/review-project-completion-status
Sep 17, 2025
Merged

feat: add pdf ingestion lane#16
POWERFULMOVES merged 1 commit into
mainfrom
codex/review-project-completion-status

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Sep 17, 2025

Copy link
Copy Markdown
Owner

Summary

  • add a pdf-ingest FastAPI service that downloads PDFs from MinIO, extracts them with libs.langextract, forwards chunks to extract-worker, and emits ingestion events
  • register an ingest.document.ready.v1 contract, wire the service into docker-compose, provide defaults/smoke coverage, and document the MinIO-to-Qdrant flow

Testing

  • python -m compileall pmoves/services/pdf-ingest

https://chatgpt.com/codex/tasks/task_b_68c9dec59e5c8324a68fa4f8a8ad6b97

Summary by CodeRabbit

  • New Features
    • Introduced a PDF ingestion service with a /pdf/ingest API and health check, pulling PDFs from MinIO/S3, extracting text, and forwarding chunks for indexing. Supports page limits and emits related events.
    • Added a “document ready” event schema and topic.
  • Documentation
    • Expanded Data Import guide with end-to-end PDF ingestion steps, configuration, and notes.
  • Chores
    • Docker Compose now includes the pdf-ingest service.
    • New Make targets: smoke-pdf (end-to-end PDF test) and load-jsonl; help updated.
    • Added environment variables for PDF ingestion defaults.

@coderabbitai

coderabbitai Bot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a new pdf-ingest service and its Dockerfile, app, and requirements; introduces env vars and docker-compose wiring; extends Makefile with smoke tests and loaders; documents PDF ingestion; adds a new “ingest.document.ready.v1” topic and schema; updates topics catalog; and includes supporting examples and configs.

Changes

Cohort / File(s) Summary of changes
Environment config
pmoves/.env.example
Added PDF ingestion env vars: PDF_DEFAULT_BUCKET, PDF_DEFAULT_NAMESPACE, PDF_MAX_PAGES, PDF_INGEST_EXTRACT_URL.
Make targets
pmoves/Makefile
Included pdf-ingest in up; added smoke-pdf and load-jsonl; reformatted presign PUT test; updated help; added .PHONY entries.
Contracts: schema & topics
pmoves/contracts/schemas/ingest/document-ready.v1.schema.json, pmoves/contracts/topics.json
New schema for ingest.document.ready.v1; registered new topic; reordered/retained ingest.file.added.v1.
Docker compose
pmoves/docker-compose.yml
Added pdf-ingest service with build, env, deps, port 8092, profiles, and network.
Service: pdf-ingest
pmoves/services/pdf-ingest/Dockerfile, pmoves/services/pdf-ingest/app.py, pmoves/services/pdf-ingest/requirements.txt
New FastAPI service to fetch PDF from MinIO, extract text (PyMuPDF), call extract-worker, optionally publish NATS events; Dockerfile and pinned dependencies added.
Docs
pmoves/docs/DATA_IMPORT.md
Documented PDF ingestion flow, configuration, endpoints, and notes; indicated emitted events and operational guidance.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as Client
  participant I as pdf-ingest (FastAPI)
  participant S as MinIO/S3
  participant L as langextract
  participant X as extract-worker
  participant N as NATS
  participant V as Vector/Search

  U->>I: POST /pdf/ingest {bucket,key,namespace,title}
  I->>S: GET object (bucket,key)
  S-->>I: PDF bytes
  I->>I: Parse PDF (limit pages), build text
  I->>L: Extract chunks/errors (text)
  L-->>I: chunks[], errors[]
  I->>X: POST /ingest {doc, chunks}
  X-->>I: ingest result
  alt publish_events=true
    I->>N: publish ingest.file.added.v1
    I->>N: publish ingest.document.ready.v1
  end
  X->>V: Upsert chunks (downstream)
  I-->>U: {doc_id, file_id, uri, chunk_count, error_count, ingest_result}

  note over I,N: New topics include ingest.document.ready.v1
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I nibble bytes from paper leaves,
Turn pages into tidy sheaves;
A hop to MinIO, a leap to extract—
Chunks in a basket, neatly packed.
Two events squeak, “We’re ready!” “We’re done!”
Carrots for logs—ingestion won! 🥕📄


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 40df9c0 and 95f6d46.

⛔ Files ignored due to path filters (1)
  • pmoves/datasets/sample.pdf is excluded by !**/*.pdf
📒 Files selected for processing (9)
  • pmoves/.env.example (1 hunks)
  • pmoves/Makefile (4 hunks)
  • pmoves/contracts/schemas/ingest/document-ready.v1.schema.json (1 hunks)
  • pmoves/contracts/topics.json (1 hunks)
  • pmoves/docker-compose.yml (1 hunks)
  • pmoves/docs/DATA_IMPORT.md (1 hunks)
  • pmoves/services/pdf-ingest/Dockerfile (1 hunks)
  • pmoves/services/pdf-ingest/app.py (1 hunks)
  • pmoves/services/pdf-ingest/requirements.txt (1 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread pmoves/services/pdf-ingest/app.py
Comment thread pmoves/docker-compose.yml
Comment on lines +166 to +189
pdf-ingest:
build:
context: .
dockerfile: services/pdf-ingest/Dockerfile
restart: unless-stopped
env_file: [.env]
environment:
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-minio:9000}
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
- MINIO_SECURE=${MINIO_SECURE:-false}
- PDF_DEFAULT_BUCKET=${PDF_DEFAULT_BUCKET:-assets}
- PDF_DEFAULT_NAMESPACE=${PDF_DEFAULT_NAMESPACE:-pmoves}
- PDF_MAX_PAGES=${PDF_MAX_PAGES:-0}
- PDF_INGEST_EXTRACT_URL=${PDF_INGEST_EXTRACT_URL:-http://extract-worker:8083/ingest}
- NATS_URL=${NATS_URL:-nats://nats:4222}
depends_on:
extract-worker:
condition: service_started
minio:
condition: service_started
ports: ["8092:8092"]
profiles: ["workers","orchestration"]
networks: [pmoves]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Expose pdf-ingest on host port already used by publisher-discord

The new pdf-ingest service maps ports: ["8092:8092"] while publisher-discord already binds the same host port in the orchestration profile. Bringing up both profiles together (docker compose --profile orchestration up) will fail with a port-collision error and neither service will start. Consider assigning a different host port or making one of the bindings optional to avoid blocking the compose stack.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex fix comments

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Testing

  • python -m compileall pmoves/services/pdf-ingest

View task →

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex fix comments

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

  • Remapped the pdf-ingest service’s host port to 8094 in docker-compose so it no longer collides with publisher-discord when orchestration is enabled. pmoves/docker-compose.ymlL176-L189
  • Updated the smoke-pdf Makefile target to call the pdf-ingest endpoint on the new host port throughout the smoke flow. pmoves/MakefileL60-L76
  • Adjusted the data import guide to reference the revised pdf-ingest port in the example ingestion command. pmoves/docs/DATA_IMPORT.mdL38-L41

Testing

  • ⚠️ Tests not run (not requested)

View task →

@POWERFULMOVES
POWERFULMOVES merged commit c487289 into main Sep 17, 2025
1 of 3 checks passed
POWERFULMOVES added a commit that referenced this pull request Jan 18, 2026
…tion-status

feat: add pdf ingestion lane
POWERFULMOVES pushed a commit that referenced this pull request Feb 12, 2026
Update setup_mcp.py to work with different platforms
@POWERFULMOVES
POWERFULMOVES deleted the codex/review-project-completion-status branch March 7, 2026 21:42
POWERFULMOVES pushed a commit that referenced this pull request Mar 9, 2026
Items #1-#14 and #16 are open (#15 is closed), totaling 15.
Fixes count in both P2 tracker and dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
POWERFULMOVES added a commit that referenced this pull request Mar 9, 2026
…836)

* docs(audit): resolve AB-9, update dashboard with Mar 9 findings

- AB-9 (runner queue starvation) RESOLVED: 3/4 runners online,
  CI queue healthy, CodeQL completing in ~4min
- PRs #834/#835 merge tracking added
- Dependabot: 0 open (medium alert resolved)
- Trivy failure triage: agent-zero timeout (infra), archon/deepresearch
  upstream dep pins needed, pmoves-yt urllib3 quick fix
- Docker Bench Security unblocked by AB-9 resolution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(security): refresh P2 tracker with tiered prioritization

- Update date from 2026-02-26 to 2026-03-09
- Re-prioritize 14 open items into 3 tiers:
  4 production-blocking, 6 tracked improvements, 5 cosmetic
- Add "Blocks Production?" column with rationale per item
- Confirm no P2s fixed by PRs #827-#835 (CI/docs/build-gate only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(docs): correct P2 open-item count from 14 to 15

Items #1-#14 and #16 are open (#15 is closed), totaling 15.
Fixes count in both P2 tracker and dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Shaela Bello <slbello@uncg.edu>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
POWERFULMOVES added a commit that referenced this pull request Jun 2, 2026
…p (camera-fit + viewer-hardening) (#1681)

Records the fork commit production runs after merging fork #15 (embed camera
fit) and #16 (#1667 concern-B surfaceFn guard) into PMOVES.AI-Edition-Hardened.
c3c2b39 -> bf3d922. website/hyperdim/ is generated/gitignored and re-syncs from
this pin at deploy; this keeps main's recorded pointer in step with the live
deploy for reproducibility.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant