Skip to content

test(backend): guard settings.VERSION against pyproject.toml drift (7 releases behind) - #63

Merged
Shaan-alpha merged 2 commits into
mainfrom
fix/backend-version-drift-guard
Jul 31, 2026
Merged

test(backend): guard settings.VERSION against pyproject.toml drift (7 releases behind)#63
Shaan-alpha merged 2 commits into
mainfrom
fix/backend-version-drift-guard

Conversation

@Shaan-alpha

Copy link
Copy Markdown
Owner

Closes the loose end noted while investigating #59: backend/pyproject.toml was on 1.0.3 while every other version constant was on 1.0.10 — seven releases behind, unnoticed.

Why it drifted

v1.0.7 existed because of this exact class of bug: the UI shipped a stale v1.0.3 badge through three releases because APP_VERSION was a third constant nobody remembered to bump. That slice added a drift guard — but only over the frontend pair (site.ts::APP_VERSION vs package.json).

The backend pair (settings.py::VERSION vs pyproject.toml) was left unguarded, and promptly drifted the same way. The v1.0.7 spec explicitly names all four constants as the version ritual; only two of them are enforced, so the ritual was silently half-done from v1.0.4 onward.

What is correct

VERSION is what /health and the FastAPI OpenAPI doc report, and it has tracked releases accurately. So 1.0.10 is the truth and pyproject.toml is the file that was wrong — package metadata was describing a release that never shipped.

Changes

  • tests/test_settings.py — assert pyproject["project"]["version"] == VERSION. Confirmed failing first (assert '1.0.10' == '1.0.3'), and confirmed not vacuous by reintroducing the drift afterwards and watching it fail again.
  • pyproject.toml1.0.31.0.10.
  • uv.lock — relocked. It records the root package version (skill-issue-backend), so leaving it would fail v1.0.10's own manifest-drift guard at uv lock --check. One-line change; uv lock reports Updated skill-issue-backend v1.0.3 -> v1.0.10 and re-resolves all 56 packages identically.

requirements.txt deliberately untouched — uv export regenerates it byte-identically, so the only local difference was a CRLF artifact from regenerating on Windows. Verified with git diff --exit-code.

Verification

uv lock --check clean, ruff check clean, ruff format --check clean on 164 files, uv run pytest -q359 passed (358 + the new guard), 72 skipped.

The one remaining failure on this branch is test_repo_quality.py::test_oss_profile_scores_twenty_without_deployment_hint — the pre-existing fixture time bomb inherited from main, fixed by #60. Merge that first and CI here goes green.

Note on scope

This does not add a cross-stack guard — nothing asserts the backend pair and the frontend pair agree with each other. That is a bigger question (they are separately deployable, and there is a reasonable argument they need not move in lockstep), so it is left alone. What is enforced now is that each pair is internally consistent, which is what actually broke both times.

v1.0.7 added this guard on the frontend pair (site.ts::APP_VERSION vs
package.json) after the UI shipped a stale version through three releases.
The backend pair was never covered and drifted the same way: VERSION
tracked releases up to 1.0.10 while pyproject.toml sat on 1.0.3, seven
releases behind.

VERSION is what /health and the OpenAPI doc report, so 1.0.10 is the
truth and pyproject.toml is what was wrong. uv.lock records the root
package version, so it is relocked to match -- required by the v1.0.10
manifest-drift guard, which would otherwise fail on uv lock --check.
Confirmed the new guard is not vacuous by reintroducing the drift and
watching it fail.

requirements.txt deliberately not touched: uv export regenerates it
byte-identically, so the only local difference was a line-ending artifact.
Copilot AI review requested due to automatic review settings July 31, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Shaan-alpha added a commit that referenced this pull request Jul 31, 2026
Browser verification showed the popover Activity leak is not a real bug --
main already reports painted:false after browser-back. The fix was
reverted in #62 and the user-facing changelog line is removed rather than
left claiming a fix for something that was never broken.

Also records both process lessons: the first CDP run used Page.navigate
(a full document load) and proved nothing, and a jsdom-only failure is not
evidence of a product bug when portals, layout or paint are involved.
@Shaan-alpha
Shaan-alpha merged commit 12cff45 into main Jul 31, 2026
5 checks passed
@Shaan-alpha
Shaan-alpha deleted the fix/backend-version-drift-guard branch July 31, 2026 03:40
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