Skip to content

Number staged candidates past every bound version - #25

Open
Deep-Sixed wants to merge 2 commits into
mainfrom
claude/sleepy-curie-g8429q-stage-version
Open

Deep-Sixed wants to merge 2 commits into
mainfrom
claude/sleepy-curie-g8429q-stage-version

Conversation

@Deep-Sixed

Copy link
Copy Markdown
Owner

Problem

apply_updates always named a staged candidate active + 1. /admin/validate, however, binds each version to its first checksum permanently, and the binding is persisted in config_revisions.

As a result, stage → validate → stage a different edit produced the same version with a new checksum, and validation failed with 422 "already bound". Every later stage from the console collided the same way, across restarts, until the abandoned candidate was reproduced byte for byte.

Separately, a non-finite number (JSON Infinity) in a numeric field raised an uncaught OverflowError, which returned a 500.

Change

  • ConfigLifecycle.known_versions exposes every bound version.
  • /admin/config/stage passes those versions to apply_updates(..., taken_versions=...), which numbers the candidate past the highest .N under the active version's date.
  • OverflowError is now a ValueError, so the endpoint answers 422.

Tests

  • Unit tests for version skipping and the non-finite value.
  • An endpoint regression test: stage, validate, re-stage, validate, then Infinity → 422.
  • Full suite: 322 passed. Ruff is clean.
  • Run locally on Python 3.13.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lj4neZ1qzw7tpiCJ8oedxJ


Generated by Claude Code

apply_updates always named a candidate active+1, but /admin/validate
binds each version to its first checksum permanently (and persists the
binding). Stage, validate, then stage a different edit produced the same
version with a new checksum, and every later stage was refused with 422
"already bound" until the abandoned candidate was reproduced exactly.

Staging now numbers past every version the lifecycle has bound under the
active version's date. Also turns a non-finite number (JSON Infinity) in
a numeric field into a 422 instead of an uncaught OverflowError 500.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lj4neZ1qzw7tpiCJ8oedxJ
Keeps the test valid once loopback trust also requires a local Host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lj4neZ1qzw7tpiCJ8oedxJ

Copy link
Copy Markdown
Owner Author

validate failed at scripts/check-public-history.py, not in this PR's code. That script scans every fetched branch, and it flagged a private-IP literal in tests/test_loopback_host.py on #24's branch.

The fix is at the source: #24's single commit was amended to use 203.0.113.7 (a documentation address) and force-pushed, and the history scan now reports 0 findings. Failed jobs re-run once.


Generated by Claude Code

@Deep-Sixed
Deep-Sixed marked this pull request as ready for review October 11, 2026 00:42
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