Skip to content

Carry a Fleet Default .python-version for Python Repositories - #4526

Merged
ptr727 merged 4 commits into
developfrom
burndown/python-version-carried-unit
Nov 27, 2026
Merged

ptr727 merged 4 commits into
developfrom
burndown/python-version-carried-unit

Conversation

@ptr727

@ptr727 ptr727 commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

This carries the root .python-version to Python repositories as a baseline unit. It is the carried-unit part of #4187's plan step 1, declared the way the maintainer chose on #4471 (option 1).

  • spec/files.json declares { "path": ".python-version", "reference": "catalog/snippets/configs/.python-version", "appliesTo": ["python"] } with no fidelity, so it is a presence unit. This follows the Docker/README.md entry. Presence never judges content, so each repository keeps its own line, per CODESTYLE.md "Toolchain Versions". A stand-up still carries the snippet as the starting value.

  • catalog/snippets/configs/.python-version is new and holds 3.14. That is the fleet default on develop, the line the python-version action falls back to and the line the Python devcontainer tag names. The hub's own root .python-version stays at 3.13, which is the hub tooling's interpreter rather than the fleet default.

  • spec/project-types.json adds .python-version to the Python type's requiredFiles.

  • spec/validate.py adds the path to CARRIED_PATH_PINS.

  • tests/test_spec_validate.py adds PythonVersionUnitCase, which holds the unit's declaration to presence with its reference.

  • tests/test_release_guards.py extends PythonVersionLineCase.test_the_fallback_is_the_baseline_line. The line the selection step falls back to must now equal the carried snippet's content, as well as the devcontainer tag's line. So a fleet default bumped in only one of them fails the test.

Declined findings

No engine changes. spec/audit.py is not touched.

Effect on the fleet audit

A cataloged Python repository with no root .python-version now gets a LETTER file: .python-version absent finding. A read-only spec/audit.py run against one Python repository from this branch showed that finding. The hub reads clean on the unit, since it carries its own file. Until a repository adds the file, its CI still falls back to 3.14 with a warning, as #4472 shipped.

Verification

  • uv run --no-project --script spec/validate.py: OK.
  • The full unittest discover -s tests suite passed on the spec change. tests/test_spec_validate.py passed again on its own after each test edit. Ruff check and format, mypy, scripts/build_dist.py --check, scripts/repo_gate.py, and the whole-tree scripts/prose_lint.py run all pass.
  • Read-only spec/audit.py runs against the hub and one Python repository: the only new finding is the expected absent-file letter.

Closes on promotion: #4187 #4471

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 27, 2026 10:06
Declare the root .python-version as a presence unit for python
repositories, with catalog/snippets/configs/.python-version as its
reference, following the Docker/README.md precedent. Presence never
judges content, so each repository keeps its own Python line, and a
stand-up still carries the snippet's fleet default.

The snippet names 3.14, the line the python-version action falls back
to and the Python devcontainer tag names. The path joins the Python
type's requiredFiles and the CARRIED_PATH_PINS set, and a test holds
the unit to presence and the snippet to the devcontainer line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The line test read the devcontainer tag with its own copy of the reader
tests/test_release_guards.py already holds. It now holds the snippet to
the python-version action's fallback assignment, which that existing
test holds to the devcontainer tag, so the three lines stay one without
a second reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Holding the snippet's line to the python-version action either repeats
the devcontainer reader tests/test_release_guards.py holds or matches
the action's script text, which a behavior-preserving reformat breaks.
The selection test there is where that agreement belongs, so this test
keeps only the presence declaration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 27, 2026 18:20
@ptr727

ptr727 commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head dd8b70b9e9214313f27bbb5b35737e7d3d920486, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Python project baseline now includes a .python-version file set to 3.14. The Python type requires the file, and validation tracks its path. A test checks the baseline entry.

Changes: Python version baseline

Layer / File(s) Summary
Declare and validate the Python version baseline
spec/project-types.json, spec/files.json, catalog/snippets/configs/.python-version, spec/validate.py, tests/test_spec_validate.py
The Python type requires .python-version, and the baseline entry references the snippet set to 3.14. Validation tracks the path in CARRIED_PATH_PINS. A test checks the baseline entry's path, reference, and appliesTo value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • Issue 4187 is partly addressed: this change adds the version snippet and declares and tracks the path. Its action fallback, validation wiring, and letter check are not included.
  • Issue 4471 is addressed by adding the spec/files.json baseline entry and declaring the path in requiredFiles and CARRIED_PATH_PINS.
Merge Risk: Minimal · previous review dd8b7

Python repositories without a root .python-version file will now get an absent-file finding. CI behavior is unchanged and falls back to 3.14 as before. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a Fleet Default .python-version is carried for Python repositories. The raw summary confirms the new .python-version baseline entry, the python type's required file, a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: a Fleet Default .python-version is carried for Python repositories. The raw summary confirms the new .python-version baseline entry, the python type's required file, and the CARRIED_PATH_PINS addition. The objectives confirm a presence unit with the 3.14 snippet. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 07452da and dd8b70b.

Files selected for processing: 5

  • catalog/snippets/configs/.python-version
  • spec/files.json
  • spec/project-types.json
  • spec/validate.py
  • tests/test_spec_validate.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Python version snippet and action fallback can diverge, while the existing test checks the devcontainer tag instead of the snippet, allowing the action to select a stale interpreter unnoticed.

1 open issue
What changed in this PR

This pull request adds .python-version as a presence-only baseline for Python repositories while preserving each repository's selected Python version.

Changes:

  • Adds the 3.14 fleet-default catalog snippet.
  • Declares .python-version as a Python presence unit.
  • Requires the file for Python repositories and pins it as a carried path.
  • Adds validation coverage for the unit declaration.
File Description
tests/​test_spec_validate.py Adds validation coverage confirming the .python-version unit uses presence fidelity and the expected catalog reference.
spec/​validate.py Adds .python-version to the carried-path pin ledger.
spec/​project-types.json Adds .python-version to the required files for Python repositories.
spec/​files.json Declares .python-version as a presence-only carried unit for Python repositories.
catalog/​snippets/​configs/​.python-version Provides the fleet-default Python version, 3.14, as the stand-up baseline.

Review effort: Lite

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.06%. Comparing base (b38e084) to head (494cd31).
⚠️ Report is 379 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4526      +/-   ##
===========================================
- Coverage    81.60%   79.06%   -2.55%     
===========================================
  Files           26       50      +24     
  Lines         9070    16939    +7869     
===========================================
+ Hits          7402    13392    +5990     
- Misses        1668     3547    +1879     
Flag Coverage Δ
python-3.13 79.06% <ø> (-2.55%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

The selection test held the python-version action's fallback to the
devcontainer tag alone. It now also holds the line the step selects
with no root file to the carried snippet's content, so a fleet default
bumped in only one of them fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 494cd31562dd3749b15d4b4800cd7c3ea556f285, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 0d20678 into develop Nov 27, 2026
14 checks passed
@ptr727
ptr727 deleted the burndown/python-version-carried-unit branch November 27, 2026 19:03
ptr727 added a commit that referenced this pull request Nov 29, 2026
)

Promotes the 17 pull requests that landed on develop since the last
promotion (#4515).

- #4468: Leave human-authored comments as written and mirror an
out-of-flow main change to develop.
- #4519: Wait for the head's checks and merge on a base requiring none.
- #4518: Retry the workflow token readback before reporting the write
unconfirmed.
- #4451: Hold owed actions in issues, name cross-repository holds, and
pass a parked group's file in backlog-burndown.
- #4526: Carry a fleet default `.python-version` for Python
repositories.
- #4482: Register the managed SSH key through a logged-in `gh` in
setup-github.
- #4521: Extend the interrupt rule to .NET console apps.
- #4532: Retry the package upgrade once after a mirror mismatch in
`upgrade-host.sh`.
- #4535: Retry a failed package list read once in `install-tools.sh`.
- #4538: Pack each target framework's own assembly and install every
.NET line a multi-targeted repo tests.
- #4543: Fail a merge-bot wait with no other check, and share one
`read_api`.
- #4544: Let a bounded cancellation translate to a domain result in the
.NET rule.
- #4546: State that an empty check set never passes in D8.1.
- #4547: Group merge-bot check runs by App and name.
- #4549: State that the merge-bot arms auto-merge where checks gate it.
- #4550: Add full history to the collision check and catch late owed
actions.
- #4552: Hold each owed action in one issue keyed on its pull request.

## Release notes for callers

- #4526: Every Python repository without a root `.python-version` now
audits `.python-version absent`. The resync carries the fleet default.
- #4482: On Linux, a prompting ssh re-probe that fails after `gh` has
added the key now exits 0 with a network message rather than dying, so a
`bootstrap.sh` stand-up continues past it.
- #4538: `nuget-build-default` no longer passes a command-line
`OutputPath`, so a multi-targeted library packs each framework's own
assembly. The release-asset `.7z` now carries only the `.nupkg` and any
`.snupkg`. `validate-task.yml` gains a `dotnet-versions` input, whose
first entry must equal the line the root `global.json` selects.
- #4519: The merge bot now waits for the head's checks and merges on a
base requiring none. It must not reach an operational repository's pin
until every `ptr727-codegen` installation has accepted `checks: read`
and `statuses: read`.
- #4543: On a base requiring no status checks, the merge bot no longer
merges a head on which no check but its own has posted. A repository
whose bot pull requests run no CI workflow now fails that merge at the
20-minute bound instead.
- A fleet resync is owed, because carried text changed: CODESTYLE.md,
WORKFLOW.md, and several skills.

#4528 stays open: #4521 settles its first two items only, and #4544 is
related. #2552 stays open on the maintainer's fresh-host verification of
setup-github.

## Findings from the local strict review

The attested local pass on ebe721b (`main...develop`) raised 198
findings. Their outcomes:

- Declined, 193 `prose_lint` `comment-added` lines: each comment was
added by a feature pull request carrying the `comments` label (#4482,
#4518, #4519), and the promotion re-carries them without that label.
- Fixed by #4543: `.github/workflows/merge-bot-task.yml` counted an
empty check set as passing, so a head with no check posted could merge
after the settle window.
- Fixed by #4543: the merge step's `read_api` duplicated the re-arm
step's. One definition now serves both.
- Declined, `host-setup/linux/install-tools.sh:340` and
`host-setup/linux/upgrade-host.sh:178`, the duplicated `apt_retry`:
`host-setup/README.md` makes the duplication deliberate, since the Linux
and Windows scripts share no file so each is fetchable alone. Each
copy's list-read behavior matches its own README paragraph. The
maintainer confirmed the decline.
- Tracked: the managed-key probe in `host-setup/linux/setup-github.sh`
and `host-setup/windows/setup-github.ps1` is the simplification the
maintainer decided in #4527.
- Fixed by #4544:
`.agents/skills/dotnet-codestyle/references/console-lifetime.md`'s
`ToolRunner` contradicted the exception rule. The rule now lets a
bounded cancellation translate to a domain result.

The attested local pass on 78cac8c (`main...develop`) raised 199
findings. Their outcomes:

- Declined, 198 `prose_lint` `comment-added` lines: the same comments as
above plus those #4543 added under the `comments` label.
- Fixed by #4546: WORKFLOW.md D8.1 and `docs/reusable-workflows.md` did
not state that a head with no other check never merges.

The attested local pass on 95b0bad (`main...develop`) raised 198
findings, all `prose_lint` `comment-added` lines. Each is declined on
the same ground as above, since every one was added by a feature pull
request carrying the `comments` label (#4482, #4518, #4519, #4543).

The attested local pass on eb196a1 (`main...develop`) raised 198
findings, all `prose_lint` `comment-added` lines, declined on the same
ground (#4547 also carries the `comments` label).

The local pass on eb1e23d (`main...develop`) raised 200 findings:
- Declined, 198 `prose_lint` `comment-added` lines, on the same ground.
- Fixed by #4552: promotion assembly re-filed a closed owed-action
holder on every range change.
- Fixed by #4552: "The Round" step 5's done-exemption contradicted the
assembly.

The attested local pass on 19bb2d4 (`main...develop`) raised 202
findings:
- Declined, 198 `prose_lint` `comment-added` lines, on the same ground.
- Deferred to #4553 by the maintainer's decision, three findings on the
merge-bot's no-required-checks path, which reaches only operational
repositories:
  - no re-run of the wait after a head move or a green re-run;
  - stale "arm on opened/reopened" comments in `merge-bot-task.yml`;
- a recovery command in `branch-protection-and-promotion.md` that merges
at once on such a base.
- Deferred to #4554 by the maintainer's decision: an owed action whose
step is an agent's has no seat directed to take it.

## Findings from the hosted review

- Fixed by #4543: Copilot's empty-check-set finding on
`.github/workflows/merge-bot-task.yml`.
- Declined in thread: Copilot asked to collapse commit statuses by
context. The combined `/status` endpoint already returns one status per
context.
- Fixed by #4547: Copilot's finding that grouping check runs by name
alone can hide another App's failed check. Runs are now grouped by App
and name, which matches GitHub's own required-check semantics.
- Declined: the suppressed grammar finding at
`.agents/skills/decision-triage/SKILL.md:31`. "Save" there is a
preposition meaning "except".

CodeRabbit's full review on eb196a1 opened 14 threads, and Copilot
raised two suppressed findings. Their outcomes:

- Fixed by #4550: the parked-branch collision `git log` lacked
`--full-history`, and a late-merged worker's owed actions were held
nowhere (caught at promotion assembly, on the maintainer's choice of
design). #4552 then fixed the holder rule this text introduced.
- Fixed by #4549: D8.1 claimed GitHub arms auto-merge only on a base
requiring status checks.
- Deferred to #4548 by the maintainer's decision: a network failure on
`apt-get update` exits 0, so `apt_retry` never fires for it.
- Deferred to #4527 by the maintainer's decision: setup-github asks a
host reaching GitHub only through its ssh config to paste a registered
key, and two tests meant to cover that case check nothing.
- Declined in thread, each with its evidence:
  - an owed action needing another owner's repository;
  - a signal before the logger exists;
  - `latestMajor` in `global.json`;
- a retried statuses read pairing with stale check runs, the race the
settle window already bounds;
  - the third stop on PID 1;
  - `GH_FORCE_TTY`;
  - a failed list read after a signing add.
- Declined in the conversation: excluding own checks by App, since a
same-named job runs under the same Actions App, and the release's Python
fallback, which is deliberate and already on `main`.
- Filed as `pre-existing`, #4551: the re-arm job reads no base rules,
which #4549's review raised.

Closes #4470
Closes #4377
Closes #4493
Closes #4444
Closes #4445
Closes #4187
Closes #4471
Closes #4483
Closes #4530
Closes #4531
Closes #4534

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants