Skip to content

Promote develop to main: Close the Python Gate's Clear-Fix Edge Cases - #1939

Merged
ptr727 merged 1 commit into
mainfrom
develop
Sep 27, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Summary

This promotes develop to main.

Closes #1917

🤖 Generated with Claude Code

## Summary

This fixes the items in #1917 that have a clear fix and change no gate
behavior. The items that would change what the gate accepts or runs (2,
3, 4, 5, 9) moved to #1936, along with item 14's caller-level cases.
Item 1 was settled earlier in #1919.

- **Item 10:** the byte-order-mark error reuses the text `shape()`
already parsed. It used to read `pyproject.toml` a second time, so a
file deleted in between raised an uncaught `FileNotFoundError`.
- **Items 12 and 15:** `spec/validate.py` keeps a mixed `types` list's
string elements. `["pythn", 3]` now reports the unknown type and no
longer draws a false profile error. An explicit `"types": null` on a
cataloged entry gets the "add types or mark it backlog" remedy again.
- **Item 13:** `scripts/carry.py` reads `types` through a guarded
`entry_types()`. It does not use the audit's helper, because a tree
carry deliberately never loads the audit.
- **Item 15:** the `declared_types()` docstring now says it returns an
empty list, and the selftest checks the helper directly.
- **Item 6:** AUDIT.md's classification line and the python type's
`profileNote` exclude the carried `hub-fetch-run.py`. The `detect` list
itself stays `["*.py"]`: nothing reads it in code, and it has no way to
write an exclusion.
- **Item 7:** WORKFLOW.md D1.2 states that the undeclared root's test
leg runs only where `tests/` sits beside a `uv.lock` or
`requirements*.txt`.
- **Item 8:** the lint-only profile now owes tests unconditionally. Its
definition and bounds in `python.profile.detect` and `profileNote`
exclude a `requirements*.txt`.
- **Item 11:** the Codecov mechanism note ties `CODECOV_TOKEN` to a repo
carrying tests for that language.

## Verification

- The full unittest suite (1756 tests), mypy, ruff check and format,
`spec/validate.py`, and `spec/audit.py --selftest` all pass.
- The prose gate (`--diff origin/develop`), the eol checks,
`build_dist.py --check`, and `docker_lint.py` are clean.
- Each new test fails against the pre-fix code: I reverted each fix and
ran the test.
- The local strict review ran two rounds. Round 1 raised three findings:
item 8's definition was fixed, item 14 moved to #1936, and the `detect`
list was declined. Round 2 raised none.

Refs #1917. The closing keyword goes on the promotion PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 27, 2026 20:26
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d45f7103-085a-4d17-9836-f394da6b7be7


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

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.41%. Comparing base (8b47ee1) to head (9b594b9).
⚠️ Report is 286 commits behind head on main.

Files with missing lines Patch % Lines
spec/audit.py 0.00% 10 Missing ⚠️
spec/validate.py 0.00% 4 Missing ⚠️
scripts/carry.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1939      +/-   ##
==========================================
+ Coverage   55.40%   55.41%   +0.01%     
==========================================
  Files          16       16              
  Lines        7196     7209      +13     
==========================================
+ Hits         3987     3995       +8     
- Misses       3209     3214       +5     
Flag Coverage Δ
python-3.13 55.41% <20.00%> (+0.01%) ⬆️

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.

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.

Copilot review overview

🟢 Approval recommended

The changes are narrowly scoped, add direct regression tests, and align prose with existing behavior without introducing risky behavioral shifts.

Review effort: Lite
Findings: None

What changed in this PR

This PR promotes develop to main by landing a set of non-behavior-changing fixes and clarifications around the Python directory gate, plus targeted tests to lock in the corrected edge-case handling.

Changes:

  • Prevent a TOML byte-order-mark error path from re-reading pyproject.toml, and add a regression test to enforce single-read behavior.
  • Treat malformed types values more robustly by preserving string elements of mixed lists, and add tests and selftests to validate the intended handling.
  • Align workflow and type-contract documentation (including Codecov and Python profile notes) with the validator’s shipped behavior.
File Description
WORKFLOW.md Documents the undeclared-root test-leg preconditions to match validator behavior.
tests/​test_spec_validate.py Adds coverage for mixed types lists and explicit types: null remediation messaging.
tests/​test_python_directories.py Adds a regression test ensuring the BOM error path does not read the file twice.
tests/​test_carry.py Adds coverage that only string elements of types lists become selectors.
spec/​validate.py Preserves string elements from mixed types lists while still emitting a shape error.
spec/​secrets.json Clarifies that CODECOV_TOKEN is required when tests for that language exist.
spec/​project-types.json Updates Python profile/prose assertions to reflect detection and requirements behavior.
spec/​audit.py Updates declared_types() docstring and expands selftest cases for malformed types.
scripts/​carry.py Adds entry_types() helper and uses it to avoid malformed types causing selector/print issues.
AUDIT.md Excludes the carried hub-fetch-run.py helper from Python-type detection prose.
.github/​skills/​workflow-ci-contract/​references/​d-guarantees.md Generated copy of the D1.2 documentation update.
.github/​skills/​python-codestyle/​references/​profiles.md Generated copy of the lint-only profile prose update.
.github/​actions/​python-directories/​python_directories.py Reuses parsed TOML text for BOM detection instead of re-reading.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​d-guarantees.md Generated plugin copy of the D1.2 documentation update.
.claude-plugin/​fleet-skills/​skills/​python-codestyle/​references/​profiles.md Generated plugin copy of the lint-only profile prose update.
.claude-plugin/​fleet-skills/​.source-digests/​workflow-ci-contract Updates plugin source digest for workflow-ci-contract.
.claude-plugin/​fleet-skills/​.source-digests/​python-codestyle Updates plugin source digest for python-codestyle.
.agents/​skills/​workflow-ci-contract/​references/​d-guarantees.md Source skill content update for D1.2 documentation.
.agents/​skills/​python-codestyle/​references/​profiles.md Source skill content update for lint-only profile prose.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit b589c6d into main Sep 27, 2026
11 checks passed
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.

Close the Python Directory Gate's Deferred Edge Cases

2 participants