fix(review): materialize base coverage locks by content, not exact filename (org-backlog root cause) - #657
Conversation
The OpenCode coverage-evidence sandbox installs the Python locks that
`materialize_base_python_requirements.py` extracts from the PR base commit, then
runs each repo's `pytest tests` offline. Discovery was gated on an exact-basename
whitelist `{requirements-hashes.txt, requirements.lock}`, so repositories whose
hash-pinned locks live under a service subdirectory (keyverse:
`services/account_unification/requirements-dev.txt`) or use conventional dev/test
names at the root (semantic-data-portal: `requirements.txt` /
`requirements-dev.txt` / `requirements-test.txt`) materialized NOTHING. Their
offline test suites then failed to import (`pydantic`/`fastapi`/…), coverage
evidence FAILED, and OpenCode could never approve — the ruleset then blocked
merge on the resulting REQUEST_CHANGES. This is the root cause of the org-wide
PR backlog.
Select locks by content instead of name: any tracked `requirements*.txt` or
`requirements.lock` blob at the validated base SHA whose content is fully
hash-pinned is materialized. This preserves the trust invariant — an unpinned or
PR-mutable requirements file is still excluded, now by content rather than by
name, and blobs are still read only from the exact base SHA. `_requirement_lines`
joins pip-compile/uv-export backslash continuations so a spec and its `--hash=`
lines are evaluated together (the previous per-physical-line view treated the
bare `pkg==x \` spec line as unpinned and wrongly rejected fully-pinned locks).
Verified: 13 tests pass with 100% line + docstring coverage on the changed
module; running the patched materializer against the real base trees now
discovers `services/account_unification/requirements-dev.txt` for keyverse and
all four hash-pinned root locks for semantic-data-portal (previously empty),
while an unpinned `requirements.txt` and a non-requirements `uv.lock` stay
excluded. semantic-data-portal additionally needs a src-layout PYTHONPATH fix
(separate follow-up) to import its `src/`-based package.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
|
Blocker status (external, transient — not a code issue): The This PR is verified: It cannot be force-merged: the org ruleset requires an approving review from someone other than the last pusher and a passing Generated by Claude Code |
…mage build The content-based base-lock discovery (#657) now materializes every fully hash-pinned requirements*.txt at the PR base — including tool locks compiled for a different interpreter. In ContextualWisdomLab/.github itself that selects requirements-strix-ci-hashes.txt (Python 3.13 target), whose litellm==1.89.2 pin has no Python 3.14 distribution, so the trusted coverage image build aborts and every PR's coverage-evidence fails deterministically (observed on run 30502974830). Make the per-lock install best-effort: a lock that cannot install on the sandbox interpreter logs a warning and is skipped instead of killing the image build. Materialization is provisioning, not evidence — the offline test run remains the fail-closed gate and still surfaces any genuinely missing dependency for the measured suite, matching the crate-prefetch failure semantics elsewhere in this workflow. Verified: workflow YAML parses; pytest tests — 677 passed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ERVynrYEjd2TwYvusVpA9f
|
Regression report: content-based lock discovery now materializes every fully hash-pinned Fix prepared on #650 (commit 35db759): the per-lock install in the trusted image build becomes best-effort — a lock that cannot install on the sandbox interpreter logs a warning and is skipped instead of killing the build. Materialization is provisioning, not evidence; the offline test run remains the fail-closed gate. 677 contract tests pass. Note the chicken-and-egg: required reviews execute the base branch's workflow, so no PR (including #650 or a revert) can heal its own coverage — landing the fix on Generated by Claude Code |
…rage image Regression from the merged content-based lock discovery (#657): the coverage image now materializes every hash-pinned requirements*.txt at the base SHA, including this repo's tool-CI locks compiled for other interpreters (bandit/pip-audit 3.12, strix 3.13). The coverage image runs Python 3.14, and a transitive pin such as litellm==1.89.2 (Requires-Python >=3.10,<3.14) has no 3.14 wheel, so the --require-hashes install aborted the whole image build and coverage-evidence failed for every .github PR (observed on #660 run 30503230897: "No matching distribution found for litellm==1.89.2"). Make the base-requirements install loop skip a set that is not installable on the image interpreter instead of aborting the build. The essential coverage toolchain is installed separately and always present, and any genuinely missing repository test dependency still surfaces as a pytest import failure during the coverage run, so the coverage signal stays honest. Pins the failure-tolerant behavior in the agent contract test. 678 passed, scripts/ci coverage 100%, interrogate 100%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
Why
This is the root cause of the org-wide open-PR backlog. The OpenCode
coverage-evidencesandbox installs the Python locks thatscripts/ci/materialize_base_python_requirements.pyextracts from the PR base commit, then runs each repo'spytest testsoffline. Discovery was gated on an exact-basename whitelist —{"requirements-hashes.txt", "requirements.lock"}— so repos whose hash-pinned locks are named or located differently materialized nothing, their offline suites failed at import,coverage-evidenceFAILED, and OpenCode could never post APPROVE → the ruleset then blocked merge on the REQUEST_CHANGES. Observed on fresh PRs:services/account_unification/requirements-dev.txt) →ModuleNotFoundError: pydantic.requirements.txt/-dev/-test) →pydantic/jwt/fastapimissing.requirements.lock, which is exactly why it alone got its base deps.)What
Select locks by content, not name: any tracked
requirements*.txtorrequirements.lockblob at the validated base SHA whose content is fully hash-pinned is materialized._requirement_linesnow joinspip-compile/uv exportbackslash continuations, so a spec and its--hash=lines are evaluated together. (The previous per-physical-line view treated the barepkg==x \spec line as unpinned and would have wrongly rejected fully-pinned locks — the regression test covers this.)Verification
tests/test_materialize_base_python_requirements.py: 13 passed, 100% line coverage and 100% docstring on the changed module (the existing "unpinned excluded" contract still holds — now enforced by content).services/account_unification/requirements-dev.txt✅ (was empty)requirements.txt,requirements-dev.txt,requirements-graph.txt,requirements-test.txt✅ (was empty)requirements.txtand a non-requirementsuv.lockstay excluded ✅Scope / follow-up
This unblocks keyverse and every flat/subdir-layout repo. semantic-data-portal additionally needs a src-layout
PYTHONPATHfix (the sandbox runsPYTHONPATH=.but its package is undersrc/); that is a separate, carefully-staged change to the dispatch workflow + its contract tests and will follow. No behavior change outside lock discovery.🤖 Generated with Claude Code
Generated by Claude Code