Add enterprise runtime hardening#6
Closed
tasuke-pochira wants to merge 2 commits into
Closed
Conversation
Owner
|
The repo is not meant to be a production ready code.. but should be functional and simple enough that people can understand and adapt without getting overwhelmed by non-functional code. The last pull about doc comparator performance improvement was useful. However, this is going too far, adding complexity without any new/enhanced functionality added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds enterprise runtime hardening across the Proxy-Pointer suite. It focuses on making the project easier to operate,
validate, debug, and scale in controlled enterprise-style deployments.
The main changes are:
pprag doctorpprag doctor --jsonpprag eval runtimeWhy
The repo already supports strong local RAG workflows, but enterprise pilots need more than retrieval quality. They need predictable runtime behavior, measurable performance, operational checks, safer configuration, and repeatable validation.
This PR moves the codebase in that direction without changing the core Proxy-Pointer retrieval architecture.
Runtime Hardening
A new shared runtime module centralizes common model-call behavior:
This reduces duplicated retry/parsing logic across Text-Only, MultiModal, and DocComparator paths.
Document Manifest and Cache
A new document manifest layer records indexed Markdown documents by document id. This allows DocComparator to resolve
doc_id -> md_paththrough a persisted manifest instead of repeatedly scanning directories and hashing files.A shared Markdown line cache also avoids repeated file reads during context assembly.
Benefits:
DocComparator Pipeline Upgrade
DocComparator now has a dedicated comparison pipeline helper that handles:
The previous implementation processed selected Doc 1 sections serially inside the Streamlit app. This PR moves that behavior into testable core code and adds
DC_SECTION_CONCURRENCYto run multiple selected sections concurrently while preserving report order.Audit Logging
Optional metadata-only audit logging was added.
It is disabled by default and only activates when either of these is configured:
PPRAG_AUDIT_LOGDC_AUDIT_LOGThe audit events intentionally avoid prompts and document text. They record operational metadata such as section ids, match counts,
result counts, elapsed time, and event type.
Runtime Commands
This PR adds two operational commands:
These check runtime readiness without loading the full application stack.
pprag eval runtimeThis runs local deterministic runtime checks for cache and concurrency behavior without external API calls.
Deployment Scaffold
This PR adds:
These are intended for hosted pilot deployments and local deployment testing. The production env template documents runtime settings, trust flags, audit log location, and throughput knobs.
CI
A GitHub Actions workflow was added:
.github/workflows/tests.yml
It runs:
Performance Notes
Local runtime evaluation showed:
section_serial_seconds: 0.121168
section_parallel_seconds: 0.031486
section_speedup: 3.85x
Focused section-pipeline proof showed:
serial: 0.2809s
parallel: 0.0713s
speedup: 3.94x
Other expected performance improvements:
Validation
Validated locally with:
UV_CACHE_DIR=/tmp/uv-cache uv run --all-extras --group test pytest -q
Result:
22 passed, 4 warnings in 1.58s
Also validated with:
UV_CACHE_DIR=/tmp/uv-cache uv run --all-extras --group test python -m compileall -q src tests