Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3afa49b
chore: scaffold openrevise package via pyproject.toml
StartripAI May 1, 2026
d71ab26
chore: ignore egg-info/build/dist; expose openrevise.__version__
StartripAI May 1, 2026
a723c9c
refactor: move scripts/ to src/openrevise/ subpackages
StartripAI May 1, 2026
f47f43f
fix(refactor): correct parents[1]→parents[3] post-move; update produc…
StartripAI May 1, 2026
1a7944c
ci: add leak-guard workflow + self-check test
StartripAI May 1, 2026
5705a36
fix(leak-guard): exclude self-referential pattern files from scan
StartripAI May 1, 2026
a40cc5a
ci(leak-guard): delegate scan to pytest; drop duplicated bash logic
StartripAI May 1, 2026
90f32a9
ci: add pytest workflow for py3.11/3.12; harden leak-guard permissions
StartripAI May 1, 2026
7d191d9
ci: consolidate leak-guard into test workflow; add concurrency/timeou…
StartripAI May 1, 2026
1ece3b8
fix(housekeeping): dry-run must not mutate run-index
StartripAI May 1, 2026
4df0062
test(housekeeping): cover EXPIRED_NONKEY_PURGED dry-run path
StartripAI May 1, 2026
1155bc4
fix(revise_docx): friendly error when DOCX missing word/footnotes.xml
StartripAI May 1, 2026
e0270e6
feat(gates): add ITT/mITT label-binding gate, wire into pipelines
StartripAI May 1, 2026
3fb21f6
feat(sources): SourceRouter with source_type dispatch
StartripAI May 1, 2026
e26155c
feat(sources): preprint router with deepXIV → arXiv fallback
StartripAI May 1, 2026
1e0b95b
fix(preprint/arxiv): use https for arXiv API endpoint
StartripAI May 1, 2026
b6d896a
feat(sources): real PubMed/PMC/EuropePMC clients via E-utilities and …
StartripAI May 1, 2026
4474c76
docs(pubmed): clarify esearch-only scope in module docstring
StartripAI May 1, 2026
3b35d93
feat(sources): default_router wires preprint/biomed backends; arxiv s…
StartripAI May 1, 2026
039cf29
feat(router): alias 'literature' source_type to biomed dispatch for r…
StartripAI May 1, 2026
ea09330
docs: add Sources & backends section with deepXIV attribution
StartripAI May 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: test
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- run: pip install -e ".[dev]"
- run: pytest -q
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ __pycache__/
*.pyc
*.pyo
*.pyd
*.egg-info/
build/
dist/

# macOS
.DS_Store
Expand All @@ -20,3 +23,4 @@ __pycache__/
# Local runtime environment
/.venv311/
/.runtime/
.venv/
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,25 @@ Core artifacts:
Global index:
- `reports/run_index.tsv`

## Sources & backends

OpenRevise's source router can be configured to retrieve evidence from multiple categories. Pipeline code dispatches by `source_type` to the registered backend, with optional dependencies allowing graceful degradation.

- **Preprints (arXiv / medRxiv / bioRxiv):** retrieval is provided via [DeepXiv-SDK](https://github.com/DeepXiv/deepxiv_sdk) (optional, install with `pip install "openrevise[preprint-deepxiv]"`) or a built-in arXiv API client (`pip install "openrevise[preprint-arxiv]"`). If neither is installed, preprint retrieval is disabled and pipelines using non-preprint sources continue to work.
- **Biomedical literature (PubMed / PMC / Europe PMC):** built-in clients using NCBI E-utilities and the EuropePMC REST API. No optional dependencies required beyond `requests` (a base dep).
- **Scholarly indexes (Semantic Scholar / OpenAlex):** retained from the existing `ideaclaw.sources.scholar` module.
- **Regulatory & guidelines (FDA / EMA / NCCN / ESMO / ASCO / CSCO):** generic HTTP fetchers driven by `config/source_registry.yaml`.
- **Local files (PDF / DOCX / PPTX / images):** evidence extraction via `openrevise.sources.evidence_extractors`.

## Quick install

```bash
pip install openrevise # core (no preprint search)
pip install "openrevise[preprint-arxiv]" # + native arXiv client
pip install "openrevise[preprint-deepxiv]" # + DeepXiv-SDK preprint backend
pip install "openrevise[all]" # everything
```

## Repository Structure
| Path | Purpose |
|---|---|
Expand Down
5 changes: 5 additions & 0 deletions config/revision_patch_spec_template.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"meta": {
"notes": [
"Demo: when replacement contains subgroup label tuples (e.g. ITT/mITT), pipeline label-value gate checks prefix/value binding before revise."
]
},
"footnote_sources": {
"src_reg_notice": "Source: Regulatory authority notice URL ... verified on YYYY-MM-DD.",
"src_journal": "Source: Journal paper citation ... verified on YYYY-MM-DD."
Expand Down
21 changes: 21 additions & 0 deletions config/source_registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,24 @@ sources:
alias_keywords:
- sun yat-sen
- sysu
- source_id: arxiv
source_type: preprint
tier: B
country: INTL
institution_tier: ''
reliability_rule: preprint_unreviewed
alias_keywords: [arxiv]
- source_id: medrxiv
source_type: preprint
tier: B
country: INTL
institution_tier: ''
reliability_rule: preprint_unreviewed
alias_keywords: [medrxiv]
- source_id: biorxiv
source_type: preprint
tier: B
country: INTL
institution_tier: ''
reliability_rule: preprint_unreviewed
alias_keywords: [biorxiv]
54 changes: 54 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "openrevise"
version = "0.1.0.dev0"
description = "Evidence-gated revision infrastructure for high-stakes documents"
readme = "README.md"
license = { text = "Apache-2.0" }
requires-python = ">=3.11"
authors = [{ name = "StartripAI" }]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"lxml>=4.9",
"PyYAML>=6.0",
"requests>=2.31",
]

[project.optional-dependencies]
preprint-deepxiv = ["deepxiv-sdk>=0.1"]
preprint-arxiv = ["sentence-transformers>=2.2", "feedparser>=6.0"]
biomed = ["biopython>=1.83"]
mcp = ["mcp>=0.9"]
docx = ["python-docx>=1.1"]
pdf = ["pypdf>=4.0", "pdfminer.six>=20231228"]
xlsx = ["openpyxl>=3.1"]
all = ["openrevise[preprint-deepxiv,preprint-arxiv,biomed,mcp,docx,pdf,xlsx]"]
dev = ["pytest>=8.0", "pytest-cov>=4.1", "ruff>=0.5", "requests-mock>=1.11"]

[project.scripts]
openrevise = "openrevise.cli:main"
openrevise-mcp = "openrevise.mcp.server:main"

[project.urls]
Homepage = "https://github.com/StartripAI/OpenRevise"
Issues = "https://github.com/StartripAI/OpenRevise/issues"

[tool.setuptools.packages.find]
where = ["src"]
include = ["openrevise*"]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q --strict-markers"

[tool.ruff]
line-length = 100
target-version = "py311"
10 changes: 10 additions & 0 deletions src/openrevise/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""OpenRevise: Evidence-gated revision infrastructure for high-stakes documents."""

from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("openrevise")
except PackageNotFoundError: # pragma: no cover - only hit when package isn't installed
__version__ = "0.0.0+unknown"

__all__ = ["__version__"]
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import Dict, List, Tuple
from run_artifact_utils import is_valid_run_id
from openrevise.artifacts.run_artifact_utils import is_valid_run_id

W = "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}"
QUESTION_PREFIX_RE = re.compile(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pathlib import Path
from typing import Dict, List

from run_artifact_utils import read_tsv, write_tsv
from openrevise.artifacts.run_artifact_utils import read_tsv, write_tsv


RUN_INDEX_FIELDS: List[str] = [
Expand Down Expand Up @@ -85,7 +85,7 @@ def main() -> int:
parser.add_argument(
"--index",
type=Path,
default=Path(__file__).resolve().parents[1] / "reports" / "run_index.tsv",
default=Path(__file__).resolve().parents[3] / "reports" / "run_index.tsv",
)
parser.add_argument("--marker", required=True)
parser.add_argument("--run-id", required=True)
Expand Down
Empty file.
Loading
Loading