Repository navigation
refactor: compare Claude Code versions with one function - #182
Conversation
Quest-Claim: c4b15e1c08789f35
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. It puts the version gate in one strict parser (src/version.rs), and the four call sites now share its semantics. On real major.minor.patch transcripts it changes nothing.
Reviewed changes
I reviewed the full diff across all 8 files.
version::claude_version/claude_at_least: The new parser needs exactly three non-empty ASCII digit parts that fit inu64. Comparing against(2, minor, patch)as a tuple matches the oldmajor > 2 || (major == 2 && …)logic.- Call-site migration:
idle,compactionandreplaynow callclaude_at_least(…, 1, patch)with the same patch numbers (314, 290, 288/minimum_claude_patch, 242).compaction::js_numberis removed, and its only other user wasreplay.report::js_numberis a separate formatter and is not affected. - Explore attribution: A version that is missing or not plain digits still gives
ModelSource::Unknown, because the code filters throughclaude_versionbefore comparing. A regression assertion covers2.1.197-beta. minimum_claude_patch→Option<u64>: The only producer iscontrols.rs(literals 288/304), and the serialized JSON integer does not change.- Tests: One table test of malformed inputs replaces the four quirk-pinning tests. This includes the overflow case, which
idleused to treat as infinity and therefore as supported.
claude-opus-5-5 | 𝕏

Finishes
quest/m1/claude-version.md.Summary
One function,
version::claude_at_least(version, minor, patch)(src/version.rs), now decides every Claude Code version gate. It accepts a plainmajor.minor.patchof ASCII digits and compares it with2.minor.patch; a missing, malformed, or u64-overflowing version is not at least anything.It replaces
idle::supported,compaction::version_supported(plusjs_number, which only it and replay used),replay::version_supported(242 is now the namedTTL_CONTROLS_PATCH), andsubagents::version(Explore's 198 is nowEXPLORE_INHERITS_PATCH). The four quirk-pinning tests are replaced by one table test of the new function.minimum_claude_patchis nowOption<u64>so it feeds the function directly.Net: 77 insertions, 164 deletions in
src/, including the new module and its test.Behavior change
Only malformed version strings change outcome:
2.01.0x200,2.1.-0,2.1.0x100,1e3parts and similar were accepted by compaction and replay and are now unsupported;2.1.198-betastyle suffixes were accepted by subagents and are now unsupported. Explore keeps reading a missing or malformed version as unknown (the review caught my first version treating it as older than 2.1.198 and reporting Haiku), soversion::claude_versionexposes the parse andclaude_at_leastis built on it. Real versions are plain digits, so I expect no change on real transcripts.Public API
None.
WindowControl::minimum_claude_patch(not re-exported from the library) changesi64tou64; its serializedminimumClaudePatchis the same JSON integer.Validation
just check(viaquest gate): fmt, clippy-D warnings, 585 + integration tests pass.token-max doctor --since 2026-11-01 --details --plain --offline --defaultswith themainbuild and this branch's build on this host's real transcripts. Both completed. The reports are not byte-identical, but the host's active sessions added about 230 requests between the two runs (256,338 vs 256,570), so this is not a clean differential: I did not find a version-gate difference, and I did not isolate one either.Models
Size: S
Implementer: Claude Code, claude-sonnet-5-5, unknown effort (arm B)
Review
Rewritten by
quest reviewafter each round.Head: 1faa17b
Base: origin/main at 99d2cc0
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1fbdd-25ad-7f63-9851-42686e30432e, round 2Score: 10/10,
The incremental change fixes malformed-version attribution and preserves the existing version comparison behavior, with no new findings.Rounds: 2; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0
Findings: none
The last round's findings, at 24709e8:
src/subagents.rs:760:Preserve unknown attribution for unparseable Explore versions;src/subagents.rs:760 now filters recorded versions through claude_version, whose strict three-component numeric parser rejects unknown, incomplete, suffixed, and overflowing versions so they receive ModelSource::Unknown.Reviewer: Codex, gpt-6.1-sol, low effort, shadow
Session:
01a1fbdd-25ad-7bf3-a292-09dfefb98e4a, round 2Score: 10/10,
The head fixes the malformed-version attribution issue, and code inspection found no new issues in the incremental changes.Rounds: 2; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0
Findings: none
The last round's findings, at 24709e8:
src/subagents.rs:760:Keep unparseable Explore versions unknown;src/subagents.rs now filters recorded versions through claude_version before comparing releases, preserving Unknown for malformed versions, with a regression assertion for 2.1.197-beta.Summary by CodeRabbit