Repository navigation
fix(hooks): run the pre-push gate with the worktree's interpreter - #4312
Conversation
The hook invoked a bare `python`, which resolves through PATH. In a linked worktree that is either another checkout's virtualenv or an interpreter without this project's dependencies, so the gate failed on a missing `ijson` and the push was refused. Eleven of the twenty-three lanes now holding reviewed, unpublished work report exactly that blocker. The worktree's own `.venv/bin/python` is used when present, falling back to PATH so a non-provisioned checkout behaves as before. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43ecb410b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…iving atlas (#4324) ## Summary Integration batch: five lanes with disjoint file sets, merged onto one branch and verified together. | lane | change | | --- | --- | | polylogue-303r.2 | expose Sinex publication lag status | | polylogue-6fk1u | add command-shape usage insight | | polylogue-kjj8t | maintain a living codebase atlas with a verifier | | polylogue-fnm.10 | add terminal field projections to the query grammar | | polylogue-39pdi | preserve partial recovery barriers in operations | ## Problem These lanes finished but never published — the pre-push gate was resolving an interpreter without the project's dependencies, so nothing reached a PR. Per-lane PRs are also the wrong unit; the landing discipline is one PR per coherent batch. ## Solution Merged onto `integration/batch-08` with no cross-lane file overlap. One repair was needed: the atlas verifier's tests left two fixtures and a `fake_git` helper unannotated, which the repo's mypy settings reject. Types only, no behaviour change. ## Verification `devtools verify --quick` → exit 0 (was `Found 3 errors` before the annotation repair). `devtools test` over the eight changed test files → `218 passed, 3 warnings in 86.12s`. Red-flag scan on the aggregate: three flags, all read and benign — the single production-line removal is `PublicationStatus.as_dict` widening its return type from `dict[str, str | int | None]` to `dict[str, object]`; the polarity flag is three *new* `pytest.raises` cases in new tests; the gate-edit flag is `devtools/verify_atlas.py`, a new checker being added rather than an existing gate weakened. ## Residual risk Three lanes were dropped from this batch and remain unintegrated: - **polylogue-5jb8j** (retire Beads session admission, −806 lines) — fails `tests/unit/sources/test_dispatch_ordering.py::test_swapping_adjacent_stream_priorities_changes_real_dispatch_result` **on its own branch** (1 failed, 11 passed). The retirement removed a dispatch detector but left a test asserting ordering that depended on it. A lane defect, not a merge interaction. - **polylogue-4ts.5** (expose effective compaction context) — adds a query function, a store method, an API method and a 51-line CLI read view with **no test referencing `get_effective_context` anywhere**. Its repository delegation was missing entirely, so the feature could not have worked as shipped; mypy caught that gap only incidentally. - **polylogue-biz4y** (resolve verification tools hermetically) — conflicts on `.githooks/pre-push` and `devtools/verify.py`. Its hook change is a stricter variant of what #4312 already landed (hard-fails on a missing venv rather than falling back to PATH); reconciling the two is a decision for the lane, not a merge resolution. Three pre-existing master failures were observed while baselining and are untouched by this batch: `test_config.py::TestConfig::test_config_db_path_default`, `test_config.py::TestXDGPaths::test_db_path_under_data_home`, and `test_daemon_cli.py::test_whale_cancellation_after_admission_records_continuation_then_real_completion`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
) ## Summary The pre-push hook now uses the pushed worktree's own `.venv/bin/python`. ## Problem The hook invoked a bare `python`, resolved through PATH. In a linked worktree that is either another checkout's virtualenv or an interpreter without this project's dependencies, so the gate died on a missing `ijson` and the push was refused. This is fleet-wide, not incidental: of the 23 lanes currently holding reviewed but unpublished work, 11 report exactly this blocker in their lane classification ("pre-push Python missing ijson", "blocked-env"). Finished work is sitting in worktrees because it cannot be pushed. ## Solution Resolve the interpreter from `git rev-parse --show-toplevel`, preferring `$ROOT/.venv/bin/python`, falling back to PATH so a non-provisioned checkout behaves as before. The failure message names the interpreter it tried. ## Verification In `/realm/worktrees/packet-polylogue-53ngk`, the resolved interpreter imports devtools successfully where the previous bare `python` did not. ## Residual risk A checkout without a `.venv` still depends on PATH, so it can still fail the old way — with a clearer message. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…iving atlas (#4324) ## Summary Integration batch: five lanes with disjoint file sets, merged onto one branch and verified together. | lane | change | | --- | --- | | polylogue-303r.2 | expose Sinex publication lag status | | polylogue-6fk1u | add command-shape usage insight | | polylogue-kjj8t | maintain a living codebase atlas with a verifier | | polylogue-fnm.10 | add terminal field projections to the query grammar | | polylogue-39pdi | preserve partial recovery barriers in operations | ## Problem These lanes finished but never published — the pre-push gate was resolving an interpreter without the project's dependencies, so nothing reached a PR. Per-lane PRs are also the wrong unit; the landing discipline is one PR per coherent batch. ## Solution Merged onto `integration/batch-08` with no cross-lane file overlap. One repair was needed: the atlas verifier's tests left two fixtures and a `fake_git` helper unannotated, which the repo's mypy settings reject. Types only, no behaviour change. ## Verification `devtools verify --quick` → exit 0 (was `Found 3 errors` before the annotation repair). `devtools test` over the eight changed test files → `218 passed, 3 warnings in 86.12s`. Red-flag scan on the aggregate: three flags, all read and benign — the single production-line removal is `PublicationStatus.as_dict` widening its return type from `dict[str, str | int | None]` to `dict[str, object]`; the polarity flag is three *new* `pytest.raises` cases in new tests; the gate-edit flag is `devtools/verify_atlas.py`, a new checker being added rather than an existing gate weakened. ## Residual risk Three lanes were dropped from this batch and remain unintegrated: - **polylogue-5jb8j** (retire Beads session admission, −806 lines) — fails `tests/unit/sources/test_dispatch_ordering.py::test_swapping_adjacent_stream_priorities_changes_real_dispatch_result` **on its own branch** (1 failed, 11 passed). The retirement removed a dispatch detector but left a test asserting ordering that depended on it. A lane defect, not a merge interaction. - **polylogue-4ts.5** (expose effective compaction context) — adds a query function, a store method, an API method and a 51-line CLI read view with **no test referencing `get_effective_context` anywhere**. Its repository delegation was missing entirely, so the feature could not have worked as shipped; mypy caught that gap only incidentally. - **polylogue-biz4y** (resolve verification tools hermetically) — conflicts on `.githooks/pre-push` and `devtools/verify.py`. Its hook change is a stricter variant of what #4312 already landed (hard-fails on a missing venv rather than falling back to PATH); reconciling the two is a decision for the lane, not a merge resolution. Three pre-existing master failures were observed while baselining and are untouched by this batch: `test_config.py::TestConfig::test_config_db_path_default`, `test_config.py::TestXDGPaths::test_db_path_under_data_home`, and `test_daemon_cli.py::test_whale_cancellation_after_admission_records_continuation_then_real_completion`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
) ## Summary The pre-push hook now uses the pushed worktree's own `.venv/bin/python`. ## Problem The hook invoked a bare `python`, resolved through PATH. In a linked worktree that is either another checkout's virtualenv or an interpreter without this project's dependencies, so the gate died on a missing `ijson` and the push was refused. This is fleet-wide, not incidental: of the 23 lanes currently holding reviewed but unpublished work, 11 report exactly this blocker in their lane classification ("pre-push Python missing ijson", "blocked-env"). Finished work is sitting in worktrees because it cannot be pushed. ## Solution Resolve the interpreter from `git rev-parse --show-toplevel`, preferring `$ROOT/.venv/bin/python`, falling back to PATH so a non-provisioned checkout behaves as before. The failure message names the interpreter it tried. ## Verification In `/realm/worktrees/packet-polylogue-53ngk`, the resolved interpreter imports devtools successfully where the previous bare `python` did not. ## Residual risk A checkout without a `.venv` still depends on PATH, so it can still fail the old way — with a clearer message. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…iving atlas (#4324) ## Summary Integration batch: five lanes with disjoint file sets, merged onto one branch and verified together. | lane | change | | --- | --- | | polylogue-303r.2 | expose Sinex publication lag status | | polylogue-6fk1u | add command-shape usage insight | | polylogue-kjj8t | maintain a living codebase atlas with a verifier | | polylogue-fnm.10 | add terminal field projections to the query grammar | | polylogue-39pdi | preserve partial recovery barriers in operations | ## Problem These lanes finished but never published — the pre-push gate was resolving an interpreter without the project's dependencies, so nothing reached a PR. Per-lane PRs are also the wrong unit; the landing discipline is one PR per coherent batch. ## Solution Merged onto `integration/batch-08` with no cross-lane file overlap. One repair was needed: the atlas verifier's tests left two fixtures and a `fake_git` helper unannotated, which the repo's mypy settings reject. Types only, no behaviour change. ## Verification `devtools verify --quick` → exit 0 (was `Found 3 errors` before the annotation repair). `devtools test` over the eight changed test files → `218 passed, 3 warnings in 86.12s`. Red-flag scan on the aggregate: three flags, all read and benign — the single production-line removal is `PublicationStatus.as_dict` widening its return type from `dict[str, str | int | None]` to `dict[str, object]`; the polarity flag is three *new* `pytest.raises` cases in new tests; the gate-edit flag is `devtools/verify_atlas.py`, a new checker being added rather than an existing gate weakened. ## Residual risk Three lanes were dropped from this batch and remain unintegrated: - **polylogue-5jb8j** (retire Beads session admission, −806 lines) — fails `tests/unit/sources/test_dispatch_ordering.py::test_swapping_adjacent_stream_priorities_changes_real_dispatch_result` **on its own branch** (1 failed, 11 passed). The retirement removed a dispatch detector but left a test asserting ordering that depended on it. A lane defect, not a merge interaction. - **polylogue-4ts.5** (expose effective compaction context) — adds a query function, a store method, an API method and a 51-line CLI read view with **no test referencing `get_effective_context` anywhere**. Its repository delegation was missing entirely, so the feature could not have worked as shipped; mypy caught that gap only incidentally. - **polylogue-biz4y** (resolve verification tools hermetically) — conflicts on `.githooks/pre-push` and `devtools/verify.py`. Its hook change is a stricter variant of what #4312 already landed (hard-fails on a missing venv rather than falling back to PATH); reconciling the two is a decision for the lane, not a merge resolution. Three pre-existing master failures were observed while baselining and are untouched by this batch: `test_config.py::TestConfig::test_config_db_path_default`, `test_config.py::TestXDGPaths::test_db_path_under_data_home`, and `test_daemon_cli.py::test_whale_cancellation_after_admission_records_continuation_then_real_completion`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
) ## Summary The pre-push hook now uses the pushed worktree's own `.venv/bin/python`. ## Problem The hook invoked a bare `python`, resolved through PATH. In a linked worktree that is either another checkout's virtualenv or an interpreter without this project's dependencies, so the gate died on a missing `ijson` and the push was refused. This is fleet-wide, not incidental: of the 23 lanes currently holding reviewed but unpublished work, 11 report exactly this blocker in their lane classification ("pre-push Python missing ijson", "blocked-env"). Finished work is sitting in worktrees because it cannot be pushed. ## Solution Resolve the interpreter from `git rev-parse --show-toplevel`, preferring `$ROOT/.venv/bin/python`, falling back to PATH so a non-provisioned checkout behaves as before. The failure message names the interpreter it tried. ## Verification In `/realm/worktrees/packet-polylogue-53ngk`, the resolved interpreter imports devtools successfully where the previous bare `python` did not. ## Residual risk A checkout without a `.venv` still depends on PATH, so it can still fail the old way — with a clearer message. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…iving atlas (#4324) ## Summary Integration batch: five lanes with disjoint file sets, merged onto one branch and verified together. | lane | change | | --- | --- | | polylogue-303r.2 | expose Sinex publication lag status | | polylogue-6fk1u | add command-shape usage insight | | polylogue-kjj8t | maintain a living codebase atlas with a verifier | | polylogue-fnm.10 | add terminal field projections to the query grammar | | polylogue-39pdi | preserve partial recovery barriers in operations | ## Problem These lanes finished but never published — the pre-push gate was resolving an interpreter without the project's dependencies, so nothing reached a PR. Per-lane PRs are also the wrong unit; the landing discipline is one PR per coherent batch. ## Solution Merged onto `integration/batch-08` with no cross-lane file overlap. One repair was needed: the atlas verifier's tests left two fixtures and a `fake_git` helper unannotated, which the repo's mypy settings reject. Types only, no behaviour change. ## Verification `devtools verify --quick` → exit 0 (was `Found 3 errors` before the annotation repair). `devtools test` over the eight changed test files → `218 passed, 3 warnings in 86.12s`. Red-flag scan on the aggregate: three flags, all read and benign — the single production-line removal is `PublicationStatus.as_dict` widening its return type from `dict[str, str | int | None]` to `dict[str, object]`; the polarity flag is three *new* `pytest.raises` cases in new tests; the gate-edit flag is `devtools/verify_atlas.py`, a new checker being added rather than an existing gate weakened. ## Residual risk Three lanes were dropped from this batch and remain unintegrated: - **polylogue-5jb8j** (retire Beads session admission, −806 lines) — fails `tests/unit/sources/test_dispatch_ordering.py::test_swapping_adjacent_stream_priorities_changes_real_dispatch_result` **on its own branch** (1 failed, 11 passed). The retirement removed a dispatch detector but left a test asserting ordering that depended on it. A lane defect, not a merge interaction. - **polylogue-4ts.5** (expose effective compaction context) — adds a query function, a store method, an API method and a 51-line CLI read view with **no test referencing `get_effective_context` anywhere**. Its repository delegation was missing entirely, so the feature could not have worked as shipped; mypy caught that gap only incidentally. - **polylogue-biz4y** (resolve verification tools hermetically) — conflicts on `.githooks/pre-push` and `devtools/verify.py`. Its hook change is a stricter variant of what #4312 already landed (hard-fails on a missing venv rather than falling back to PATH); reconciling the two is a decision for the lane, not a merge resolution. Three pre-existing master failures were observed while baselining and are untouched by this batch: `test_config.py::TestConfig::test_config_db_path_default`, `test_config.py::TestXDGPaths::test_db_path_under_data_home`, and `test_daemon_cli.py::test_whale_cancellation_after_admission_records_continuation_then_real_completion`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
…iving atlas (#4324) ## Summary Integration batch: five lanes with disjoint file sets, merged onto one branch and verified together. | lane | change | | --- | --- | | polylogue-303r.2 | expose Sinex publication lag status | | polylogue-6fk1u | add command-shape usage insight | | polylogue-kjj8t | maintain a living codebase atlas with a verifier | | polylogue-fnm.10 | add terminal field projections to the query grammar | | polylogue-39pdi | preserve partial recovery barriers in operations | ## Problem These lanes finished but never published — the pre-push gate was resolving an interpreter without the project's dependencies, so nothing reached a PR. Per-lane PRs are also the wrong unit; the landing discipline is one PR per coherent batch. ## Solution Merged onto `integration/batch-08` with no cross-lane file overlap. One repair was needed: the atlas verifier's tests left two fixtures and a `fake_git` helper unannotated, which the repo's mypy settings reject. Types only, no behaviour change. ## Verification `devtools verify --quick` → exit 0 (was `Found 3 errors` before the annotation repair). `devtools test` over the eight changed test files → `218 passed, 3 warnings in 86.12s`. Red-flag scan on the aggregate: three flags, all read and benign — the single production-line removal is `PublicationStatus.as_dict` widening its return type from `dict[str, str | int | None]` to `dict[str, object]`; the polarity flag is three *new* `pytest.raises` cases in new tests; the gate-edit flag is `devtools/verify_atlas.py`, a new checker being added rather than an existing gate weakened. ## Residual risk Three lanes were dropped from this batch and remain unintegrated: - **polylogue-5jb8j** (retire Beads session admission, −806 lines) — fails `tests/unit/sources/test_dispatch_ordering.py::test_swapping_adjacent_stream_priorities_changes_real_dispatch_result` **on its own branch** (1 failed, 11 passed). The retirement removed a dispatch detector but left a test asserting ordering that depended on it. A lane defect, not a merge interaction. - **polylogue-4ts.5** (expose effective compaction context) — adds a query function, a store method, an API method and a 51-line CLI read view with **no test referencing `get_effective_context` anywhere**. Its repository delegation was missing entirely, so the feature could not have worked as shipped; mypy caught that gap only incidentally. - **polylogue-biz4y** (resolve verification tools hermetically) — conflicts on `.githooks/pre-push` and `devtools/verify.py`. Its hook change is a stricter variant of what #4312 already landed (hard-fails on a missing venv rather than falling back to PATH); reconciling the two is a decision for the lane, not a merge resolution. Three pre-existing master failures were observed while baselining and are untouched by this batch: `test_config.py::TestConfig::test_config_db_path_default`, `test_config.py::TestXDGPaths::test_db_path_under_data_home`, and `test_daemon_cli.py::test_whale_cancellation_after_admission_records_continuation_then_real_completion`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
|
Closing out open Codex review threads on this PR (evidence checked against master at c950478):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
Summary
The pre-push hook now uses the pushed worktree's own
.venv/bin/python.Problem
The hook invoked a bare
python, resolved through PATH. In a linked worktree that is either another checkout's virtualenv or an interpreter without this project's dependencies, so the gate died on a missingijsonand the push was refused.This is fleet-wide, not incidental: of the 23 lanes currently holding reviewed but unpublished work, 11 report exactly this blocker in their lane classification ("pre-push Python missing ijson", "blocked-env"). Finished work is sitting in worktrees because it cannot be pushed.
Solution
Resolve the interpreter from
git rev-parse --show-toplevel, preferring$ROOT/.venv/bin/python, falling back to PATH so a non-provisioned checkout behaves as before. The failure message names the interpreter it tried.Verification
In
/realm/worktrees/packet-polylogue-53ngk, the resolved interpreter imports devtools successfully where the previous barepythondid not.Residual risk
A checkout without a
.venvstill depends on PATH, so it can still fail the old way — with a clearer message.🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA