-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add an aggregate gate, CodeQL and the AI review configuration #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gabrielspadon
wants to merge
4
commits into
main
Choose a base branch
from
ci/house-standard-and-codeql
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1c12d58
ci: add an aggregate gate, CodeQL and the AI review configuration
gabrielspadon 4c6b116
ci: drop the advanced CodeQL config that conflicts with default setup
gabrielspadon b00ee22
ci: iterate the needs context and stop excluding key paths from review
gabrielspadon 2b7b845
security: stop excluding key files from review in the public repo
gabrielspadon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,167 @@ | ||
| # yaml-language-server: $schema=https://storage.googleapis.com/coderabbit_public_assets/schema.v2.json | ||
| # | ||
| # CodeRabbit configuration for CiteForge. Keys are taken from the published | ||
| # schema above, so an unknown key fails validation rather than being ignored. | ||
| # | ||
| # Scope of this file: what CodeRabbit reads, and what it should say. It is not a | ||
| # gate. The one required status check stays `Required CI` in | ||
| # .github/workflows/tests.yml, and `reviews.request_changes_workflow` is left | ||
| # false so a review comment never blocks a merge on its own. | ||
|
|
||
| language: en-US | ||
|
|
||
| tone_instructions: >- | ||
| Direct and technical. No praise, no restating the diff. Prose avoids em-dashes, | ||
| avoids colons inside sentences, and never opens a paragraph with a bolded phrase | ||
| standing in for a heading. | ||
|
|
||
| early_access: false | ||
|
|
||
| reviews: | ||
| profile: assertive | ||
| # The CI workflow is the gate. A review must not be able to block a merge by | ||
| # itself, which is what request_changes_workflow would do. | ||
| request_changes_workflow: false | ||
| high_level_summary: true | ||
| review_status: true | ||
| collapse_walkthrough: false | ||
| changed_files_summary: true | ||
| sequence_diagrams: false | ||
| assess_linked_issues: true | ||
| related_issues: true | ||
| related_prs: true | ||
| # No commit status, so the branch ruleset keeps exactly one required check. | ||
| commit_status: false | ||
| poem: false | ||
| in_progress_fortune: false | ||
| abort_on_close: true | ||
|
|
||
| auto_review: | ||
| enabled: true | ||
| drafts: false | ||
| base_branches: | ||
| - main | ||
|
|
||
| # Excluded from review entirely: hash-pinned lock files, generated pipeline | ||
| # output, and cached API responses. Every path here is either listed in | ||
| # .gitignore or is machine-generated rather than authored. output/ is tracked | ||
| # but written by the monthly refresh job, not by hand. | ||
| path_filters: | ||
| - "!requirements.lock" | ||
| - "!requirements-dev.lock" | ||
| - "!output/**" | ||
| - "!data/api_cache/**" | ||
| - "!.venv/**" | ||
| - "!build/**" | ||
| - "!dist/**" | ||
| - "!**/*.egg-info/**" | ||
|
|
||
| # Conventions below are quoted from CLAUDE.md and pyproject.toml, not | ||
| # invented. Keep them in sync with those two files. | ||
| path_instructions: | ||
| - path: "citeforge/**/*.py" | ||
| instructions: >- | ||
| Type annotations on every public function and method, enforced by mypy with | ||
| disallow_untyped_defs and check_untyped_defs (pyproject.toml [tool.mypy]). | ||
| Formatting and linting are ruff at line-length 120 with rules | ||
| E/F/W/I/N/UP/B/C4/SIM/RUF/S; the repository does not run ruff format, so do | ||
| not propose reformatting. | ||
|
|
||
| Flag any violation of the invariants CLAUDE.md states: | ||
| thresholds, API endpoints, trust order, rate limits and compound word | ||
| dictionaries live in citeforge/config.py and are never hardcoded elsewhere | ||
| ("Config-driven"); the pipeline produces byte-identical output across | ||
| consecutive cache-hit runs, so directory and file iteration uses sorted() and | ||
| nothing that affects output is randomized ("Determinism"); DOI comparison goes | ||
| through _norm_doi() from citeforge/id_utils.py and is always paired with a | ||
| title_similarity >= 0.55 check; an orphan .bib file is never deleted without | ||
| verifying it as a duplicate at title_similarity >= 0.95. | ||
|
|
||
| FUSED_COMPOUND_WORDS and ABBREVIATED_VENUE_MAP must contain no em-dash and no | ||
| accented characters, because the serializer strips them. | ||
|
|
||
| Comments and log messages are English. Prose in comments avoids em-dashes, | ||
| avoids colons inside sentences, and does not open a paragraph with a bolded | ||
| pseudo-heading. Do not accept new TODO markers. | ||
| - path: "citeforge/merge_utils.py" | ||
| instructions: >- | ||
| Trust hierarchy. merge_with_policy() merges fields from 13 ranked sources with | ||
| override rules for DOI (published beats preprint), journal (never downgrade to | ||
| a preprint), title (prefer the longer), pages (reject invalid) and booktitle | ||
| (upgrade a generic series to the conference name). A change to the ranking or | ||
| to any override rule changes published bibliographic output, so it needs a | ||
| test that pins the new behaviour. | ||
| - path: "citeforge/pipeline/**/*.py" | ||
| instructions: >- | ||
| CLAUDE.md "Three-Way Fix Pattern" is the critical invariant here. A fix to | ||
| entry types, titles or booktitles must be applied in all three places, or the | ||
| output oscillates between consecutive runs: _fixup_bib_entry() on load, the | ||
| existing-file fixup in process_article() before enrichment, and the Phase 4 | ||
| post-merge step. The consolidated helpers _fix_title_text() and | ||
| _apply_booktitle_fixups() are called from all three. Flag a new text or type | ||
| fix added to fewer than all three call sites. | ||
| - path: "citeforge/clients/**/*.py" | ||
| instructions: >- | ||
| Scholarly API clients. API keys are read from keys/, which is gitignored, and | ||
| must never be inlined, logged, or written into output. This repository is | ||
| public, so a raw API response must not be committed to the tree; the monthly | ||
| refresh encrypts its cache before pushing. Check that new HTTP calls go through | ||
| citeforge/http_utils.py rather than calling requests directly, so retry and | ||
| rate-limit handling stays in one place. | ||
| - path: "tests/**/*.py" | ||
| instructions: >- | ||
| pytest with plain assert statements, fixtures and @pytest.mark.parametrize. | ||
| Shared fixtures live in tests/conftest.py and tests/fixtures.py. HTTP is mocked | ||
| with monkeypatch and a unit test never makes a real API call; integration tests | ||
| that need keys auto-skip when the keys are absent. Flag a test that is skipped | ||
| or xfailed instead of fixed, and flag an assertion that cannot fail. Coverage | ||
| has a floor of 68 percent enforced by --cov-fail-under in the CI test job, so a | ||
| change that drops coverage below it fails the build. | ||
|
|
||
| CLAUDE.md forbids adding automated audit modules; issues are fixed in pipeline | ||
| code or by direct .bib edits. | ||
| - path: ".github/workflows/*.yml" | ||
| instructions: >- | ||
| Actions are pinned by commit SHA with the version in a trailing comment, never | ||
| by tag or branch. Every job carries timeout-minutes. Any job added must also be | ||
| added to the `needs` list of the `CI` job named `Required CI` in tests.yml, | ||
| which is the single aggregate status check branch protection requires; a job | ||
| outside that list is unprotected. This repository stays on GitHub Actions and | ||
| must not gain a .circleci directory. | ||
| - path: "**/*.md" | ||
| instructions: >- | ||
| Prose avoids em-dashes, avoids colons inside sentences, and never opens a | ||
| paragraph with a bolded phrase used as a heading. CLAUDE.md owns the | ||
| architecture description and the Three-Way Fix Pattern; link to it rather than | ||
| restating it. Do not commit counts or statistics that drift with normal | ||
| pipeline runs. | ||
|
|
||
| tools: | ||
| ruff: | ||
| enabled: true | ||
| actionlint: | ||
| enabled: true | ||
| gitleaks: | ||
| enabled: true | ||
| markdownlint: | ||
| enabled: true | ||
| shellcheck: | ||
| enabled: true | ||
| yamllint: | ||
| enabled: true | ||
| # Off deliberately: this repository has no JavaScript, TypeScript, Docker or | ||
| # Helm surface, so these only produce noise. | ||
| eslint: | ||
| enabled: false | ||
| biome: | ||
| enabled: false | ||
| hadolint: | ||
| enabled: false | ||
|
|
||
| chat: | ||
| auto_reply: true | ||
|
|
||
| knowledge_base: | ||
| opt_out: false | ||
| learnings: | ||
| scope: local | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Qodo Merge (PR-Agent) repository configuration. | ||
| # | ||
| # Read from the root of the repository's DEFAULT branch, so a change here only | ||
| # takes effect once merged. Only keys that override a default are listed; every | ||
| # key below exists in pr_agent/settings/configuration.toml or | ||
| # pr_agent/settings/ignore.toml upstream. | ||
| # | ||
| # This is advice, not a gate. The single required status check stays | ||
| # `Required CI` in .github/workflows/tests.yml. | ||
|
|
||
| [config] | ||
| response_language = "en-US" | ||
|
|
||
| # Excluded from analysis: hash-pinned lock files, generated pipeline output, and | ||
| # cached API responses. Each path is either listed in .gitignore or is | ||
| # machine-generated rather than authored. output/ is tracked but written by the | ||
| # monthly refresh job, not by hand. | ||
| [ignore] | ||
| glob = [ | ||
| 'requirements.lock', | ||
| 'requirements-dev.lock', | ||
| 'output/**', | ||
| 'data/api_cache/**', | ||
| '.venv/**', | ||
| 'build/**', | ||
| 'dist/**', | ||
| '**/*.egg-info/**', | ||
| ] | ||
| # No `regex` entry. `.*\.key$` excluded exactly the files a leaked credential | ||
| # would live in, in a PUBLIC repository whose own instructions two sections | ||
| # below say to treat a committed API key as a defect. An earlier commit removed | ||
| # the equivalent glob exclusions from .coderabbit.yaml and greptile.json but | ||
| # missed this one, which is a different key in the same file. | ||
|
|
||
| [pr_reviewer] | ||
| require_tests_review = true | ||
| require_security_review = true | ||
| require_estimate_effort_to_review = false | ||
| require_can_be_split_review = false | ||
| require_todo_scan = true | ||
| persistent_comment = true | ||
| num_max_findings = 5 | ||
| extra_instructions = """\ | ||
| Direct and technical. No praise, no restating the diff. Prose avoids em-dashes, avoids colons inside sentences, and never opens a paragraph with a bolded phrase standing in for a heading. | ||
|
|
||
| Do not repeat what CI already reports. ruff lints, mypy typechecks, and a coverage floor of 68 percent is enforced by --cov-fail-under in the test job. Report only defects a maintainer would act on. | ||
|
|
||
| This repository is public. Treat anything that could commit an API key, a raw API response, or a contributor's private data as a defect rather than a nit. Keys are read from the gitignored keys/ directory and must never be inlined, logged or written into output. | ||
|
|
||
| Python conventions from CLAUDE.md and pyproject.toml: type annotations on every public function and method (mypy runs with disallow_untyped_defs and check_untyped_defs), ruff at line-length 120 with rules E/F/W/I/N/UP/B/C4/SIM/RUF/S. The repository does not run ruff format, so do not propose reformatting. | ||
|
|
||
| Invariants a change must not break: | ||
| - Config-driven. Thresholds, API endpoints, trust order, rate limits and compound word dictionaries live in citeforge/config.py and are never hardcoded elsewhere. | ||
| - Determinism. The pipeline produces byte-identical output across consecutive cache-hit runs. Directory and file iteration uses sorted(), and nothing that affects output is randomized. | ||
| - DOI comparison goes through _norm_doi() from citeforge/id_utils.py and is always paired with a title_similarity >= 0.55 check. | ||
| - An orphan .bib file is never deleted without verifying it as a duplicate at title_similarity >= 0.95. | ||
| - FUSED_COMPOUND_WORDS and ABBREVIATED_VENUE_MAP contain no em-dash and no accented characters, because the serializer strips them. | ||
|
|
||
| Under citeforge/pipeline/, the Three-Way Fix Pattern is critical. A fix to entry types, titles or booktitles must be applied in all three places or the output oscillates between consecutive runs: _fixup_bib_entry() on load, the existing-file fixup in process_article() before enrichment, and the Phase 4 post-merge step. Flag a new text or type fix added to fewer than all three call sites. | ||
|
|
||
| Under citeforge/merge_utils.py, merge_with_policy() ranks 13 sources with override rules for DOI, journal, title, pages and booktitle. A change to the ranking or to an override rule changes published bibliographic output and needs a test that pins the new behaviour. | ||
|
|
||
| Under tests/, HTTP is mocked with monkeypatch and a unit test never makes a real API call; integration tests that need keys auto-skip when the keys are absent. Flag a test skipped or xfailed instead of fixed, and flag an assertion that cannot fail. | ||
|
|
||
| In .github/workflows/, every action is pinned by commit SHA with a trailing version comment and every job carries timeout-minutes. A job added to tests.yml must also be added to the needs list of the CI job named Required CI, or it is not covered by branch protection. This repository stays on GitHub Actions and must not gain a .circleci directory. | ||
| """ | ||
|
|
||
| [pr_code_suggestions] | ||
| commitable_code_suggestions = false | ||
| focus_only_on_problems = true | ||
| persistent_comment = true | ||
| extra_instructions = """\ | ||
| Suggest a change only when the current code is wrong, unsafe, or breaks a stated invariant. Do not suggest stylistic rewrites, do not suggest adding abstractions for hypothetical future needs, and do not suggest a dependency where a few lines of the standard library would do. | ||
|
|
||
| Never suggest adding an automated audit module; CLAUDE.md states that issues are fixed in pipeline code or by direct .bib edits. Never suggest hardcoding a threshold, endpoint or trust rank outside citeforge/config.py. | ||
| """ |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.