paperbrief 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. paperbrief-0.1.0/.dockerignore +9 -0
  2. paperbrief-0.1.0/.env.example +22 -0
  3. paperbrief-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +30 -0
  4. paperbrief-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +18 -0
  5. paperbrief-0.1.0/.github/ISSUE_TEMPLATE/new_pack.yml +24 -0
  6. paperbrief-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +10 -0
  7. paperbrief-0.1.0/.github/dependabot.yml +10 -0
  8. paperbrief-0.1.0/.github/workflows/ci.yml +65 -0
  9. paperbrief-0.1.0/.github/workflows/feeds-check.yml +21 -0
  10. paperbrief-0.1.0/.github/workflows/release.yml +67 -0
  11. paperbrief-0.1.0/.gitignore +43 -0
  12. paperbrief-0.1.0/.pre-commit-config.yaml +19 -0
  13. paperbrief-0.1.0/CHANGELOG.md +19 -0
  14. paperbrief-0.1.0/CITATION.cff +18 -0
  15. paperbrief-0.1.0/CODE_OF_CONDUCT.md +85 -0
  16. paperbrief-0.1.0/CONTRIBUTING.md +71 -0
  17. paperbrief-0.1.0/Dockerfile +13 -0
  18. paperbrief-0.1.0/LICENSE +202 -0
  19. paperbrief-0.1.0/Makefile +30 -0
  20. paperbrief-0.1.0/PKG-INFO +285 -0
  21. paperbrief-0.1.0/README.md +241 -0
  22. paperbrief-0.1.0/SECURITY.md +20 -0
  23. paperbrief-0.1.0/docs/architecture.md +43 -0
  24. paperbrief-0.1.0/docs/configuration.md +147 -0
  25. paperbrief-0.1.0/docs/delivery.md +67 -0
  26. paperbrief-0.1.0/docs/faq.md +33 -0
  27. paperbrief-0.1.0/docs/models-and-effort.md +55 -0
  28. paperbrief-0.1.0/docs/privacy-and-terms.md +26 -0
  29. paperbrief-0.1.0/docs/roadmap.md +16 -0
  30. paperbrief-0.1.0/docs/scheduling.md +44 -0
  31. paperbrief-0.1.0/docs/setup-with-ai.md +32 -0
  32. paperbrief-0.1.0/docs/sources-and-packs.md +52 -0
  33. paperbrief-0.1.0/docs/troubleshooting.md +25 -0
  34. paperbrief-0.1.0/examples/paperbrief.biomed.yaml +105 -0
  35. paperbrief-0.1.0/examples/paperbrief.ml.yaml +105 -0
  36. paperbrief-0.1.0/examples/paperbrief.physics.yaml +105 -0
  37. paperbrief-0.1.0/examples/paperbrief.social-science.yaml +105 -0
  38. paperbrief-0.1.0/examples/profile-example.md +18 -0
  39. paperbrief-0.1.0/pyproject.toml +69 -0
  40. paperbrief-0.1.0/src/paperbrief/__init__.py +3 -0
  41. paperbrief-0.1.0/src/paperbrief/__main__.py +3 -0
  42. paperbrief-0.1.0/src/paperbrief/cli.py +536 -0
  43. paperbrief-0.1.0/src/paperbrief/config/__init__.py +0 -0
  44. paperbrief-0.1.0/src/paperbrief/config/loader.py +181 -0
  45. paperbrief-0.1.0/src/paperbrief/config/schema.py +208 -0
  46. paperbrief-0.1.0/src/paperbrief/config/template.yaml.j2 +116 -0
  47. paperbrief-0.1.0/src/paperbrief/data/env.example +22 -0
  48. paperbrief-0.1.0/src/paperbrief/deliver/__init__.py +207 -0
  49. paperbrief-0.1.0/src/paperbrief/llm/__init__.py +0 -0
  50. paperbrief-0.1.0/src/paperbrief/llm/core.py +158 -0
  51. paperbrief-0.1.0/src/paperbrief/llm/engines.py +216 -0
  52. paperbrief-0.1.0/src/paperbrief/llm/presets.py +97 -0
  53. paperbrief-0.1.0/src/paperbrief/models.py +56 -0
  54. paperbrief-0.1.0/src/paperbrief/net.py +85 -0
  55. paperbrief-0.1.0/src/paperbrief/packs/biomed.yaml +19 -0
  56. paperbrief-0.1.0/src/paperbrief/packs/cancer.yaml +11 -0
  57. paperbrief-0.1.0/src/paperbrief/packs/chemistry.yaml +8 -0
  58. paperbrief-0.1.0/src/paperbrief/packs/comp-path.yaml +11 -0
  59. paperbrief-0.1.0/src/paperbrief/packs/cs.yaml +6 -0
  60. paperbrief-0.1.0/src/paperbrief/packs/earth.yaml +8 -0
  61. paperbrief-0.1.0/src/paperbrief/packs/economics.yaml +7 -0
  62. paperbrief-0.1.0/src/paperbrief/packs/ml.yaml +7 -0
  63. paperbrief-0.1.0/src/paperbrief/packs/neuroscience.yaml +8 -0
  64. paperbrief-0.1.0/src/paperbrief/packs/physics.yaml +8 -0
  65. paperbrief-0.1.0/src/paperbrief/packs/psychology.yaml +6 -0
  66. paperbrief-0.1.0/src/paperbrief/packs/social-science.yaml +6 -0
  67. paperbrief-0.1.0/src/paperbrief/pipeline/__init__.py +0 -0
  68. paperbrief-0.1.0/src/paperbrief/pipeline/ai.py +311 -0
  69. paperbrief-0.1.0/src/paperbrief/pipeline/fulltext.py +105 -0
  70. paperbrief-0.1.0/src/paperbrief/pipeline/run.py +155 -0
  71. paperbrief-0.1.0/src/paperbrief/pipeline/select.py +64 -0
  72. paperbrief-0.1.0/src/paperbrief/prompts/brief.md +21 -0
  73. paperbrief-0.1.0/src/paperbrief/prompts/edit.md +22 -0
  74. paperbrief-0.1.0/src/paperbrief/prompts/overview.md +13 -0
  75. paperbrief-0.1.0/src/paperbrief/prompts/profile_draft.md +8 -0
  76. paperbrief-0.1.0/src/paperbrief/prompts/rank.md +18 -0
  77. paperbrief-0.1.0/src/paperbrief/render/__init__.py +128 -0
  78. paperbrief-0.1.0/src/paperbrief/render/templates/digest.md.j2 +63 -0
  79. paperbrief-0.1.0/src/paperbrief/render/templates/email.html.j2 +114 -0
  80. paperbrief-0.1.0/src/paperbrief/render/templates/feed.xml.j2 +17 -0
  81. paperbrief-0.1.0/src/paperbrief/schedule/__init__.py +205 -0
  82. paperbrief-0.1.0/src/paperbrief/secrets.py +41 -0
  83. paperbrief-0.1.0/src/paperbrief/sources/__init__.py +44 -0
  84. paperbrief-0.1.0/src/paperbrief/sources/apis.py +183 -0
  85. paperbrief-0.1.0/src/paperbrief/sources/common.py +41 -0
  86. paperbrief-0.1.0/src/paperbrief/sources/feeds.py +92 -0
  87. paperbrief-0.1.0/src/paperbrief/sources/resolve.py +76 -0
  88. paperbrief-0.1.0/src/paperbrief/store.py +57 -0
  89. paperbrief-0.1.0/templates/github-actions/paperbrief.yml +48 -0
  90. paperbrief-0.1.0/tests/__init__.py +0 -0
  91. paperbrief-0.1.0/tests/conftest.py +83 -0
  92. paperbrief-0.1.0/tests/fixtures/arxiv.rss +11 -0
  93. paperbrief-0.1.0/tests/fixtures/biorxiv.json +3 -0
  94. paperbrief-0.1.0/tests/fixtures/crossref.json +2 -0
  95. paperbrief-0.1.0/tests/fixtures/efetch.xml +5 -0
  96. paperbrief-0.1.0/tests/fixtures/esearch.json +1 -0
  97. paperbrief-0.1.0/tests/fixtures/hf.json +2 -0
  98. paperbrief-0.1.0/tests/fixtures/nature.rss +17 -0
  99. paperbrief-0.1.0/tests/fixtures/openalex.json +3 -0
  100. paperbrief-0.1.0/tests/integration/__init__.py +0 -0
  101. paperbrief-0.1.0/tests/integration/test_run.py +136 -0
  102. paperbrief-0.1.0/tests/unit/__init__.py +0 -0
  103. paperbrief-0.1.0/tests/unit/test_config.py +87 -0
  104. paperbrief-0.1.0/tests/unit/test_examples_and_live.py +70 -0
  105. paperbrief-0.1.0/tests/unit/test_llm.py +124 -0
  106. paperbrief-0.1.0/tests/unit/test_no_private_info.py +76 -0
  107. paperbrief-0.1.0/tests/unit/test_pipeline_parts.py +112 -0
  108. paperbrief-0.1.0/tests/unit/test_sources.py +65 -0
@@ -0,0 +1,9 @@
1
+ .git
2
+ .venv
3
+ .env
4
+ paperbrief-data
5
+ tests
6
+ docs
7
+ dist
8
+ build
9
+ **/__pycache__
@@ -0,0 +1,22 @@
1
+ # Copy to .env (never commit .env). Only set what your config uses.
2
+ # AI providers (via LiteLLM)
3
+ OPENAI_API_KEY=
4
+ ANTHROPIC_API_KEY=
5
+ GEMINI_API_KEY=
6
+ OPENROUTER_API_KEY=
7
+ # Ollama runs locally; no key. Default: http://localhost:11434
8
+ OLLAMA_API_BASE=
9
+
10
+ # Email (SMTP). For Gmail/Outlook use an app password, not your normal password.
11
+ PAPERBRIEF_SMTP_PASSWORD=
12
+ # Or the Resend API
13
+ RESEND_API_KEY=
14
+
15
+ # Chat delivery
16
+ SLACK_WEBHOOK_URL=
17
+ DISCORD_WEBHOOK_URL=
18
+ TELEGRAM_BOT_TOKEN=
19
+ TELEGRAM_CHAT_ID=
20
+
21
+ # Optional: your email for Unpaywall open-access lookups and polite API use
22
+ PAPERBRIEF_CONTACT_EMAIL=
@@ -0,0 +1,30 @@
1
+ name: Bug report
2
+ description: Something does not work
3
+ labels: [bug]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: "Remove secrets, email addresses and private paths before you paste logs."
8
+ - type: textarea
9
+ id: what
10
+ attributes:
11
+ label: What happened, and what did you expect?
12
+ validations:
13
+ required: true
14
+ - type: textarea
15
+ id: steps
16
+ attributes:
17
+ label: Steps to reproduce
18
+ placeholder: "paperbrief doctor ... / paperbrief preview ..."
19
+ - type: textarea
20
+ id: logs
21
+ attributes:
22
+ label: Relevant log lines (paperbrief-data/logs/<date>.log)
23
+ render: text
24
+ - type: input
25
+ id: version
26
+ attributes:
27
+ label: Version and OS
28
+ placeholder: "paperbrief 0.1.0, macOS 15, Python 3.12, preset anthropic"
29
+ validations:
30
+ required: true
@@ -0,0 +1,18 @@
1
+ name: Feature request
2
+ description: Suggest an idea
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: What problem would this solve?
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ id: idea
13
+ attributes:
14
+ label: Your idea
15
+ - type: textarea
16
+ id: alternatives
17
+ attributes:
18
+ label: Alternatives you considered
@@ -0,0 +1,24 @@
1
+ name: New source pack
2
+ description: Propose a pack of feeds for a field
3
+ labels: [pack]
4
+ body:
5
+ - type: input
6
+ id: field
7
+ attributes:
8
+ label: Field
9
+ placeholder: "e.g. ecology, mathematics, nursing"
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: feeds
14
+ attributes:
15
+ label: Journals, feeds or preprint servers (with URLs, ISSNs or DOI prefixes)
16
+ validations:
17
+ required: true
18
+ - type: checkboxes
19
+ id: checks
20
+ attributes:
21
+ label: Checks
22
+ options:
23
+ - label: I ran `paperbrief sources check --pack <name>` and every feed works
24
+ - label: The feeds are official RSS feeds or Crossref/API sources (no scraping)
@@ -0,0 +1,10 @@
1
+ ## What and why
2
+
3
+ ## How I tested it
4
+ - [ ] `make lint test`
5
+ - [ ] (if relevant) `paperbrief sources check --pack ...` or `make live`
6
+
7
+ ## Checklist
8
+ - [ ] No secrets, personal data or real digests in the diff
9
+ - [ ] Docs updated (README / docs/)
10
+ - [ ] `CHANGELOG.md` updated under Unreleased
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: "/"
5
+ schedule:
6
+ interval: monthly
7
+ - package-ecosystem: github-actions
8
+ directory: "/"
9
+ schedule:
10
+ interval: monthly
@@ -0,0 +1,65 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest, macos-latest]
17
+ python: ["3.10", "3.11", "3.12", "3.13"]
18
+ runs-on: ${{ matrix.os }}
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python }}
24
+ - run: pip install -e ".[all,dev]"
25
+ - run: ruff check src tests
26
+ - run: ruff format --check src tests
27
+ - run: pytest
28
+
29
+ types:
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: actions/setup-python@v5
34
+ with:
35
+ python-version: "3.12"
36
+ - run: pip install -e ".[all,dev]"
37
+ - run: mypy src
38
+
39
+ secrets-scan:
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ with:
44
+ fetch-depth: 0
45
+ - name: Install gitleaks
46
+ run: curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.24.3/gitleaks_8.24.3_linux_x64.tar.gz | tar -xz gitleaks
47
+ - name: Scan the full git history
48
+ run: ./gitleaks detect --source . --redact -v
49
+
50
+ build:
51
+ runs-on: ubuntu-latest
52
+ steps:
53
+ - uses: actions/checkout@v4
54
+ - uses: actions/setup-python@v5
55
+ with:
56
+ python-version: "3.12"
57
+ - run: pip install build && python -m build
58
+ - run: pip install dist/*.whl && paperbrief --version && paperbrief packs
59
+
60
+ docker:
61
+ runs-on: ubuntu-latest
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+ - run: docker build -t paperbrief:ci .
65
+ - run: docker run --rm paperbrief:ci --version
@@ -0,0 +1,21 @@
1
+ name: Feeds check
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "17 3 * * 1"
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ feeds:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.12"
19
+ - run: pip install -e .
20
+ - name: Fetch every feed in every pack once
21
+ run: paperbrief sources check
@@ -0,0 +1,67 @@
1
+ name: Release
2
+
3
+ # A v* tag publishes to PyPI. A manual run (Actions tab or `gh workflow run release.yml`) publishes to TestPyPI.
4
+ on:
5
+ push:
6
+ tags: ["v*"]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+ - name: Tag must match the package version
21
+ if: github.event_name == 'push'
22
+ run: |
23
+ version=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
24
+ test "$GITHUB_REF_NAME" = "v$version" || { echo "tag $GITHUB_REF_NAME does not match version $version"; exit 1; }
25
+ - run: pip install build twine
26
+ - run: python -m build
27
+ - run: twine check --strict dist/*
28
+ - name: List the sdist contents
29
+ run: tar -tzf dist/*.tar.gz
30
+ - uses: actions/upload-artifact@v4
31
+ with:
32
+ name: dist
33
+ path: dist/
34
+
35
+ publish-testpypi:
36
+ if: github.event_name == 'workflow_dispatch'
37
+ needs: build
38
+ runs-on: ubuntu-latest
39
+ environment:
40
+ name: testpypi
41
+ url: https://test.pypi.org/p/paperbrief
42
+ permissions:
43
+ id-token: write
44
+ steps:
45
+ - uses: actions/download-artifact@v4
46
+ with:
47
+ name: dist
48
+ path: dist/
49
+ - uses: pypa/gh-action-pypi-publish@release/v1
50
+ with:
51
+ repository-url: https://test.pypi.org/legacy/
52
+
53
+ publish-pypi:
54
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
55
+ needs: build
56
+ runs-on: ubuntu-latest
57
+ environment:
58
+ name: pypi
59
+ url: https://pypi.org/p/paperbrief
60
+ permissions:
61
+ id-token: write
62
+ steps:
63
+ - uses: actions/download-artifact@v4
64
+ with:
65
+ name: dist
66
+ path: dist/
67
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,43 @@
1
+ # Secrets and personal config (never commit)
2
+ .env
3
+ .env.*
4
+ !.env.example
5
+ *.key
6
+ *.pem
7
+ secrets/
8
+ paperbrief.yaml
9
+ !examples/*.yaml
10
+ profile.md
11
+ !examples/profile-example.md
12
+
13
+ # Run data
14
+ state/
15
+ logs/
16
+ out/
17
+ digests/
18
+ site/
19
+ *.sqlite
20
+ *.sqlite3
21
+
22
+ # Python
23
+ __pycache__/
24
+ *.py[cod]
25
+ .venv/
26
+ venv/
27
+ dist/
28
+ build/
29
+ *.egg-info/
30
+ .pytest_cache/
31
+ .mypy_cache/
32
+ .ruff_cache/
33
+ .coverage
34
+ htmlcov/
35
+
36
+ # OS / editors
37
+ .DS_Store
38
+ .idea/
39
+ .vscode/
40
+ paperbrief-data/
41
+
42
+ # Local leak-gate patterns (never commit)
43
+ .private-patterns
@@ -0,0 +1,19 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: end-of-file-fixer
6
+ - id: trailing-whitespace
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+ - id: detect-private-key
10
+ - repo: https://github.com/astral-sh/ruff-pre-commit
11
+ rev: v0.8.0
12
+ hooks:
13
+ - id: ruff
14
+ args: [--fix]
15
+ - id: ruff-format
16
+ - repo: https://github.com/gitleaks/gitleaks
17
+ rev: v8.21.2
18
+ hooks:
19
+ - id: gitleaks
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes are listed here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [0.1.0] - 2026-12-03
8
+
9
+ ### Added
10
+ - **Sources:** daily digest pipeline over RSS, arXiv, bioRxiv/medRxiv, Hugging Face trending, OpenAlex, Crossref (journals by ISSN or name, DOI prefixes) and PubMed. Twelve field packs.
11
+ - **AI steps:** keyword filter, then AI scoring, briefs (legal open full text when available), an optional editor pass and an overview.
12
+ - **Engines:** Claude Code CLI, Codex CLI, LiteLLM (OpenAI, Anthropic, Gemini, OpenRouter, Ollama, …) and a mock engine.
13
+ - Model, effort, timeout, parallelism and fallbacks are set per step.
14
+ - Presets fill all steps at once.
15
+ - **Delivery:** email (SMTP presets or Resend), Slack, Discord, Telegram, a Markdown folder with save checkboxes, and a static site with RSS.
16
+ - **Scheduling:** launchd, systemd, cron, Windows Task Scheduler, and a GitHub Actions template.
17
+ - **Commands:** `init` (guided, AI-drafted or non-interactive), `doctor`, `preview`, `run`, `add`, `sources`, `packs`, `models`, `cost`, `config`, `schedule`, `secret`.
18
+ - **Fail-safes:** run lock, network wait, retries, per-feed isolation, fallback models, budget caps, abstract-only fallback, papers marked as sent only after delivery, catch-up after missed days, failure notices.
19
+ - **Logging:** a trace of every AI call, and AI usage in each digest footer.
@@ -0,0 +1,18 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use PaperBrief in your work, please cite it as below."
3
+ title: "PaperBrief: daily AI briefs of new research papers for any field"
4
+ type: software
5
+ version: 0.1.0
6
+ date-released: 2026-12-03
7
+ license: Apache-2.0
8
+ repository-code: "https://github.com/Kakarrxt/paperbrief"
9
+ authors:
10
+ - family-names: Gupta
11
+ given-names: Kanav
12
+ email: kanav@nus.edu.sg
13
+ keywords:
14
+ - research papers
15
+ - literature monitoring
16
+ - large language models
17
+ - arXiv
18
+ - bioRxiv
@@ -0,0 +1,85 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
7
+
8
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
9
+
10
+ ## Our Standards
11
+
12
+ Examples of behavior that contributes to a positive environment for our community include:
13
+
14
+ * Demonstrating empathy and kindness toward other people
15
+ * Being respectful of differing opinions, viewpoints, and experiences
16
+ * Giving and gracefully accepting constructive feedback
17
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
18
+ * Focusing on what is best not just for us as individuals, but for the overall community
19
+
20
+ Examples of unacceptable behavior include:
21
+
22
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
26
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
27
+
28
+ ## Enforcement Responsibilities
29
+
30
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
31
+
32
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
33
+
34
+ ## Scope
35
+
36
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37
+
38
+ ## Enforcement
39
+
40
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement through the private contact listed in SECURITY.md. All complaints will be reviewed and investigated promptly and fairly.
41
+
42
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
43
+
44
+ ## Enforcement Guidelines
45
+
46
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
47
+
48
+ ### 1. Correction
49
+
50
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
51
+
52
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
53
+
54
+ ### 2. Warning
55
+
56
+ **Community Impact**: A violation through a single incident or series of actions.
57
+
58
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
59
+
60
+ ### 3. Temporary Ban
61
+
62
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
63
+
64
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
65
+
66
+ ### 4. Permanent Ban
67
+
68
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
69
+
70
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
71
+
72
+ ## Attribution
73
+
74
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
75
+
76
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
77
+
78
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
79
+
80
+ [homepage]: https://www.contributor-covenant.org
81
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
82
+ [Mozilla CoC]: https://github.com/mozilla/diversity
83
+ [FAQ]: https://www.contributor-covenant.org/faq
84
+ [translations]: https://www.contributor-covenant.org/translations
85
+
@@ -0,0 +1,71 @@
1
+ # Contributing to PaperBrief
2
+
3
+ Thanks for helping. Bug reports, new source packs, AI providers, delivery channels, docs and fixes are all welcome.
4
+
5
+ ## Ground rules
6
+
7
+ - Be kind; see the [Code of Conduct](CODE_OF_CONDUCT.md).
8
+ - Open an issue before a large change, so we can agree on the approach.
9
+ - Never commit secrets, personal data or real digests. The tests include a leak check.
10
+ - Keep sources legal and polite. Use official feeds and APIs, respect rate limits, and never bypass a paywall.
11
+
12
+ ## Development setup
13
+
14
+ ```bash
15
+ git clone https://github.com/Kakarrxt/paperbrief && cd paperbrief
16
+ python -m venv .venv && source .venv/bin/activate # or: uv venv && source .venv/bin/activate
17
+ pip install -e ".[all,dev]"
18
+ pre-commit install # optional: lint and secret scan on commit
19
+ make test # offline tests, no network, no AI
20
+ ```
21
+
22
+ | Command | What it does |
23
+ |---|---|
24
+ | `make test` | Unit and integration tests, fully offline (fixtures + mock AI) |
25
+ | `make lint` | ruff and mypy |
26
+ | `make format` | ruff format |
27
+ | `make live` | Live tests: real feeds, and one tiny call to each logged-in AI CLI (`PAPERBRIEF_LIVE=1`) |
28
+ | `make feeds` | Fetch every pack feed once |
29
+ | `make build` | Build the wheel and sdist |
30
+
31
+ ## How to add…
32
+
33
+ **A source pack:**
34
+ 1. Add `src/paperbrief/packs/<name>.yaml` with a `description` and `feeds` (see the existing packs).
35
+ 2. Run `paperbrief sources check --pack <name>`.
36
+ 3. Prefer official RSS feeds or Crossref (by ISSN or DOI prefix).
37
+ 4. Set `filter: true` on high-volume feeds.
38
+
39
+ **A feed type:**
40
+ 1. Write a fetcher in `sources/feeds.py` or `sources/apis.py` that returns `list[Paper]`.
41
+ 2. Register it in `sources/__init__.py:FETCHERS` and add the type to `config/schema.py:Feed`.
42
+ 3. Add a fixture and a test in `tests/unit/test_sources.py`.
43
+
44
+ **An AI provider:**
45
+ 1. Add an engine to `llm/engines.py` with the signature `(stage, system, prompt, schema) -> (dict, tokens, cost)`.
46
+ 2. Raise `AuthError` for login or key problems and `ModelNotFound` for bad model IDs.
47
+ 3. Register it in `llm/core.py:_engine` and in `config/schema.py:Provider`.
48
+ 4. Add a test with a faked subprocess or client.
49
+
50
+ **A delivery channel:**
51
+ 1. Add it to `deliver/__init__.py` and a config block to `config/schema.py:Delivery`.
52
+ 2. Read secrets only through `secrets.get(NAME)`.
53
+ 3. Document it in `docs/delivery.md`.
54
+
55
+ **Prompt changes:** edit `src/paperbrief/prompts/*.md`. Say in the pull request what you changed and why, with a before-and-after example digest (no private content).
56
+
57
+ ## Code style
58
+
59
+ - Python 3.10+, ruff (line length 120), type hints on public functions.
60
+ - Comments only where the logic is not obvious.
61
+ - A new behaviour comes with a test. Tests must run offline: use `tests/conftest.py` fixtures and the `mock` provider.
62
+
63
+ ## Pull requests
64
+
65
+ 1. Branch from `main`.
66
+ 2. Keep each pull request focused.
67
+ 3. Update `CHANGELOG.md` under "Unreleased".
68
+ 4. `make lint test` passes. CI runs on Python 3.10–3.13 on Linux and macOS.
69
+ 5. Describe what changed and how you tested it.
70
+
71
+ By contributing, you agree that your contribution is licensed under Apache-2.0.
@@ -0,0 +1,13 @@
1
+ FROM python:3.12-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
4
+ WORKDIR /app
5
+ COPY pyproject.toml README.md LICENSE ./
6
+ COPY src ./src
7
+ RUN pip install --no-cache-dir ".[api,pdf]" && useradd --create-home paperbrief
8
+
9
+ USER paperbrief
10
+ WORKDIR /config
11
+ # Mount a folder holding paperbrief.yaml, profile.md and .env at /config.
12
+ ENTRYPOINT ["paperbrief"]
13
+ CMD ["run", "--config", "/config/paperbrief.yaml"]