Skip to content

1.8.0 rc - #232

Merged
rostilos merged 3 commits into
mainfrom
1.8.0-rc
Jul 29, 2026
Merged

1.8.0 rc#232
rostilos merged 3 commits into
mainfrom
1.8.0-rc

Conversation

@rostilos

@rostilos rostilos commented Jul 29, 2026

Copy link
Copy Markdown
Owner

fix(rag): tolerate custom Magento XML and recover Qdrant writes

  • exclude nested custom etc XML from Magento architecture parsing
  • keep custom XML available for generic semantic indexing
  • retry transient Qdrant upsert failures with bounded backoff
  • split rejected batches to isolate oversized or invalid points
  • preserve atomic index publication after exhausted recovery
  • add regression coverage and update RAG/plugin documentation

feat: newrelic for RAG Pipeline service

Summary by CodeRabbit

  • New Features
    • Resilient indexing writes with retries and automatic subdivision to quarantine invalid records.
    • New Relic APM support across pipeline and inference services.
  • Bug Fixes
    • Improved Magento XML classification and safety: unsafe/malformed config XML is quarantined without breaking repository analysis; unresolved entities no longer fail runs.
    • Runtime now isolates per-artifact ingestion failures and continues processing.
    • Indexing/pr responses now include additional skip/quarantine metrics.
  • Documentation
    • Updated capability and Magento XML boundary documentation for resilient/quarantined behavior.
  • Deployment / CI
    • Added monitoring config requirements, health checks, and admission/heartbeat settings for more predictable startup.

rostilos added 2 commits July 29, 2026 10:42
- exclude nested custom etc XML from Magento architecture parsing
- keep custom XML available for generic semantic indexing
- retry transient Qdrant upsert failures with bounded backoff
- split rejected batches to isolate oversized or invalid points
- preserve atomic index publication after exhausted recovery
- add regression coverage and update RAG/plugin documentation
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 875ee559-472d-49c6-9ba6-c6ae65a05750

📥 Commits

Reviewing files that changed from the base of the PR and between 24d7b25 and 5088a74.

📒 Files selected for processing (39)
  • README.md
  • analysis-plugins/README.md
  • analysis-plugins/contracts/python/codecrow_plugins/api.py
  • analysis-plugins/contracts/python/codecrow_plugins/runtime.py
  • analysis-plugins/contracts/python/tests/test_builtin_plugins.py
  • analysis-plugins/contracts/python/tests/test_magento_repository_analysis.py
  • analysis-plugins/contracts/python/tests/test_repository_runtime_resilience.py
  • analysis-plugins/frameworks/magento/python/codecrow_plugin_magento/architecture.py
  • analysis-plugins/frameworks/magento/python/codecrow_plugin_magento/repository.py
  • deployment/.env.sample
  • deployment/config/inference-orchestrator/.env.sample
  • deployment/docker-compose.prod.yml
  • deployment/docker-compose.yml
  • java-ecosystem/libs/analysis-engine/pom.xml
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/aiclient/AiAnalysisClient.java
  • java-ecosystem/libs/analysis-engine/src/test/java/org/rostilos/codecrow/analysisengine/aiclient/AiAnalysisClientTest.java
  • java-ecosystem/libs/queue/src/main/java/org/rostilos/codecrow/queue/RedisQueueService.java
  • java-ecosystem/libs/queue/src/test/java/org/rostilos/codecrow/queue/RedisQueueServiceTest.java
  • java-ecosystem/services/pipeline-agent/src/test/java/org/rostilos/codecrow/pipelineagent/generic/service/IsolatedReviewProducerReplayTest.java
  • python-ecosystem/inference-orchestrator/src/api/routers/health.py
  • python-ecosystem/inference-orchestrator/src/server/queue_consumer.py
  • python-ecosystem/inference-orchestrator/tests/test_queue_consumer.py
  • python-ecosystem/rag-pipeline/integration/conftest.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/api/routers/pr.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/core/index_manager/indexer.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/core/index_manager/point_operations.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/core/index_representation.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/core/splitter/splitter.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/models/config.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/services/base.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/services/semantic_search.py
  • python-ecosystem/rag-pipeline/tests/test_deterministic_context.py
  • python-ecosystem/rag-pipeline/tests/test_incremental_repository_overlay.py
  • python-ecosystem/rag-pipeline/tests/test_index_representation.py
  • python-ecosystem/rag-pipeline/tests/test_indexer.py
  • python-ecosystem/rag-pipeline/tests/test_point_operations.py
  • python-ecosystem/rag-pipeline/tests/test_router_pr.py
  • python-ecosystem/rag-pipeline/tests/test_services.py
  • python-ecosystem/rag-pipeline/tests/test_splitter.py

📝 Walkthrough

Walkthrough

Changes

Resilient indexing and writes

Layer / File(s) Summary
Point write retry and isolation
python-ecosystem/rag-pipeline/src/rag_pipeline/core/index_manager/point_operations.py, tests/test_point_operations.py
Adds retry, exponential backoff, batch subdivision, rejected-point isolation, embedding isolation, and detailed write results while preserving systemic failures.
Recovery-tolerant indexing and overlays
python-ecosystem/rag-pipeline/src/rag_pipeline/core/index_manager/*, src/rag_pipeline/core/splitter/*, src/rag_pipeline/api/routers/pr.py, tests/*
Quarantines missing files, split failures, recoverable diagnostics, and rejected points, then reports skipped files and chunks.

Magento XML and plugin diagnostics

Layer / File(s) Summary
Magento XML classification and repository handling
analysis-plugins/frameworks/magento/python/codecrow_plugin_magento/*, analysis-plugins/README.md, tests/test_builtin_plugins.py
Restricts architecture analysis to recognized Magento configuration paths and quarantines malformed or unsafe configuration XML.
Plugin diagnostic propagation
analysis-plugins/contracts/python/codecrow_plugins/*, tests/*
Adds diagnostic paths and recoverability metadata, continues after per-artifact ingestion failures, and aggregates contribution diagnostics.

Index compatibility semantics

Layer / File(s) Summary
Descriptor-based compatibility
python-ecosystem/rag-pipeline/src/rag_pipeline/core/index_representation.py, src/rag_pipeline/services/*, src/rag_pipeline/api/routers/pr.py, README.md
Treats implementation fingerprints as provenance while retaining descriptor, snapshot, and vector-shape compatibility checks.
Compatibility regression coverage
python-ecosystem/rag-pipeline/tests/*
Updates tests for older implementation fingerprints, descriptor mismatches, deterministic context selection, and router behavior.

Consumer heartbeat and admission control

Layer / File(s) Summary
Consumer heartbeat and health reporting
python-ecosystem/inference-orchestrator/src/server/*, src/api/routers/health.py, tests/*
Publishes a Redis heartbeat, checks consumer task and key health, and returns HTTP 503 when the consumer is unavailable.
Analysis admission and cleanup
java-ecosystem/libs/analysis-engine/src/main/java/.../AiAnalysisClient.java, tests/*
Adds pre-enqueue liveness checks, bounded admission timeouts, post-acknowledgement inactivity timeouts, and pending-job cleanup.
Queue operations
java-ecosystem/libs/queue/*, pipeline-agent/.../IsolatedReviewProducerReplayTest.java
Adds Redis key-existence and exact-list-removal operations and updates the synthetic queue implementation.

RAG pipeline observability deployment

Layer / File(s) Summary
Observable runtime image
python-ecosystem/rag-pipeline/Dockerfile.observable, requirements*, .gitignore
Adds a multi-stage runtime image with New Relic dependencies, cache settings, non-root execution, and an instrumented startup command.
Environment boot and ASGI instrumentation
python-ecosystem/rag-pipeline/main.py, src/rag_pipeline/api/api.py
Loads environment configuration, initializes New Relic when configured, and conditionally wraps the FastAPI application.
Deployment configuration and generated agent files
deployment/ci/*, deployment/docker-compose*.yml, deployment/config/*
Generates service-specific New Relic files, validates required configuration, selects the observable image, and adds health-conditioned service dependencies.

Estimated code review effort: 5 (Critical) | ~100 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant AiAnalysisClient
  participant RedisQueueService
  participant RedisQueueConsumer
  participant InferenceHealth
  Client->>AiAnalysisClient: Submit analysis request
  AiAnalysisClient->>RedisQueueService: Check consumer heartbeat
  RedisQueueService-->>AiAnalysisClient: Heartbeat present or absent
  AiAnalysisClient->>RedisQueueService: Enqueue job
  RedisQueueConsumer->>RedisQueueService: Publish heartbeat
  InferenceHealth->>RedisQueueConsumer: Check is_healthy()
  RedisQueueConsumer-->>InferenceHealth: Consumer health
  AiAnalysisClient->>RedisQueueService: Remove pending job during cleanup
Loading
sequenceDiagram
  participant RepositoryIndexer
  participant PointOperations
  participant Qdrant
  participant IndexStats
  RepositoryIndexer->>PointOperations: Upsert points
  PointOperations->>Qdrant: Retry batch upsert
  Qdrant-->>PointOperations: Accepted or rejected points
  PointOperations-->>RepositoryIndexer: PointWriteResult
  RepositoryIndexer->>IndexStats: Record successful and skipped counts
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is a release label, but it does not describe the actual changes in the pull request. Use a concise descriptive title that names the main change, such as resilient RAG upserts and New Relic instrumentation.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1.8.0-rc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
python-ecosystem/rag-pipeline/tests/test_point_operations.py (1)

156-230: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider covering the new constructor validation paths.

The three ValueError guards added in PointOperations.__init__ (batch_size, upsert_max_attempts, upsert_retry_base_seconds) are currently untested, and test_upsert_isolates_one_rejected_point_without_losing_valid_siblings relies on the default upsert_max_attempts implicitly — worth making explicit if the default ever changes.

💚 Optional test addition
import pytest


`@pytest.mark.parametrize`(
    "kwargs",
    [
        {"batch_size": 0},
        {"upsert_max_attempts": 0},
        {"upsert_retry_base_seconds": -1},
    ],
)
def test_invalid_upsert_configuration_is_rejected(kwargs):
    with pytest.raises(ValueError):
        PointOperations(MagicMock(), MagicMock(), **kwargs)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python-ecosystem/rag-pipeline/tests/test_point_operations.py` around lines
156 - 230, Add tests for the three constructor validation paths in
PointOperations.__init__, asserting ValueError for batch_size=0,
upsert_max_attempts=0, and upsert_retry_base_seconds=-1, preferably via
parametrization. Also set upsert_max_attempts explicitly in
test_upsert_isolates_one_rejected_point_without_losing_valid_siblings instead of
relying on its default.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@analysis-plugins/frameworks/magento/python/codecrow_plugin_magento/architecture.py`:
- Around line 58-59: Update the unsafe-XML diagnostic message in safe_xml() to
describe the affected path as Magento XML input rather than Magento
configuration, covering layout, UI-component, and theme XML accurately while
preserving the existing entity-declaration details.

In `@python-ecosystem/rag-pipeline/Dockerfile.observable`:
- Around line 57-59: Update the New Relic environment configuration near
NEW_RELIC_CONFIG_FILE to replace the unsupported NEW_RELIC_LOG_FILE_NAME setting
with the Python agent variable NEW_RELIC_LOG, configured to output logs to
stdout.

---

Nitpick comments:
In `@python-ecosystem/rag-pipeline/tests/test_point_operations.py`:
- Around line 156-230: Add tests for the three constructor validation paths in
PointOperations.__init__, asserting ValueError for batch_size=0,
upsert_max_attempts=0, and upsert_retry_base_seconds=-1, preferably via
parametrization. Also set upsert_max_attempts explicitly in
test_upsert_isolates_one_rejected_point_without_losing_valid_siblings instead of
relying on its default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b5aa24d-dc7d-4d20-ad0d-1850c279a116

📥 Commits

Reviewing files that changed from the base of the PR and between d442106 and 24d7b25.

📒 Files selected for processing (20)
  • README.md
  • analysis-plugins/README.md
  • analysis-plugins/contracts/python/tests/test_builtin_plugins.py
  • analysis-plugins/frameworks/magento/python/codecrow_plugin_magento/__init__.py
  • analysis-plugins/frameworks/magento/python/codecrow_plugin_magento/architecture.py
  • analysis-plugins/frameworks/magento/python/codecrow_plugin_magento/repository.py
  • deployment/ci/ci-build.sh
  • deployment/ci/server-deploy.sh
  • deployment/ci/server-init.sh
  • deployment/config/.gitignore
  • deployment/config/rag-pipeline/.env.sample
  • deployment/docker-compose.prod.yml
  • python-ecosystem/rag-pipeline/.gitignore
  • python-ecosystem/rag-pipeline/Dockerfile.observable
  • python-ecosystem/rag-pipeline/main.py
  • python-ecosystem/rag-pipeline/requirements.local.txt
  • python-ecosystem/rag-pipeline/requirements.txt
  • python-ecosystem/rag-pipeline/src/rag_pipeline/api/api.py
  • python-ecosystem/rag-pipeline/src/rag_pipeline/core/index_manager/point_operations.py
  • python-ecosystem/rag-pipeline/tests/test_point_operations.py

Comment on lines +57 to +59
# New Relic observability. The config file is mounted by production Compose.
ENV NEW_RELIC_CONFIG_FILE=/app/newrelic.ini
ENV NEW_RELIC_LOG_FILE_NAME=STDOUT

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

curl -fsSL \
  'https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration/' \
  | grep -Eo 'NEW_RELIC_(LOG|LOG_FILE_NAME)' \
  | sort -u

Repository: rostilos/CodeCrow

Length of output: 169


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Dockerfile target =="
sed -n '1,90p' python-ecosystem/rag-pipeline/Dockerfile.observable || true

echo
echo "== New Relic env/file references =="
rg -n "NEW_RELIC|newrelic|log_file_name|LOG_FILE_NAME|NEW_RELIC_LOG" . || true

echo
echo "== Pip requirements / package manifest mentions =="
rg -n "newrelic|NEW_RELIC" -g 'requirements*.txt' -g 'pyproject.toml' -g 'setup.py' -g 'setup.cfg' -g 'Pipfile' -g 'poetry.lock' -g 'uv.lock' . || true

Repository: rostilos/CodeCrow

Length of output: 11152


Use the supported Python New Relic log setting.

NEW_RELIC_LOG_FILE_NAME is the Java agent option and is ignored by this Python runtime, so stdout diagnostics won’t be configured by this Docker ENV. Use the Python agent env var instead: NEW_RELIC_LOG=stdout.

Proposed fix
-ENV NEW_RELIC_LOG_FILE_NAME=STDOUT
+ENV NEW_RELIC_LOG=stdout
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# New Relic observability. The config file is mounted by production Compose.
ENV NEW_RELIC_CONFIG_FILE=/app/newrelic.ini
ENV NEW_RELIC_LOG_FILE_NAME=STDOUT
# New Relic observability. The config file is mounted by production Compose.
ENV NEW_RELIC_CONFIG_FILE=/app/newrelic.ini
ENV NEW_RELIC_LOG=stdout
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python-ecosystem/rag-pipeline/Dockerfile.observable` around lines 57 - 59,
Update the New Relic environment configuration near NEW_RELIC_CONFIG_FILE to
replace the unsupported NEW_RELIC_LOG_FILE_NAME setting with the Python agent
variable NEW_RELIC_LOG, configured to output logs to stdout.

…xing

- isolate loader, parser, plugin, embedding, and point-write failures
- continue indexing valid files and deterministic architecture context
- treat recoverable plugin diagnostics as file-level skips
- remove stale chunks when changed files become invalid
- preserve atomic rollback for infrastructure and integrity failures
- report skipped file and chunk counts
- document indexing quarantine and failure semantics
- add full, incremental, PR-overlay, plugin, and Qdrant coverage

Deployment note: fully reindex existing branches because the neutral and plugin implementation fingerprints changed.
@rostilos
rostilos merged commit 1f535ab into main Jul 29, 2026
1 check was pending
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.

1 participant