Skip to content

Cover computeReleaseInfo: channel selection, assisted gating, migration fallback - #864

Merged
selfcontained merged 1 commit into
mainfrom
agt_a058d66a445d/job-test-enforcer-f10effa1
Aug 2, 2026
Merged

Cover computeReleaseInfo: channel selection, assisted gating, migration fallback#864
selfcontained merged 1 commit into
mainfrom
agt_a058d66a445d/job-test-enforcer-f10effa1

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

apps/server/src/release-info.ts owns the assistedRequired classification for the update path but had zero direct coveragerelease-auto-check.test.ts mocks computeReleaseInfo away entirely. This was the top-ranked gap from the last test-enforcer coverage audit.

Adds apps/server/test/release-info.test.ts (24 tests, no product code changes):

  • deriveCurrentTag chain — release-store tag wins (version info never consulted), trimmed v-prefix fallback from app version, plain-semver regex rejection of prerelease versions, null when nothing is known.
  • Channel / latest-tag selection — stable skips prereleases while absoluteLatestTag keeps the newest overall; latest channel takes prereleases; unknown channel settings coerce to stable; all-prerelease stable case yields latestTag: null; gh release list failure falls back to sorted local git tags with the v-prefix filter.
  • updateAvailable — false for unknown current tag / equal / older latest; true for newer, with release metadata loaded and the notes body kept out of the snapshot.
  • Assisted gating — through the real release-metadata parser: required mode forces assistedRequired, recommended does not, appliesFrom above the current install skips the gate, and a malformed dispatch-update fence hard-fails with ok: false before any tarball work.
  • Migration evaluation — pending manifests map through the real toSummary (no manifest internals leak), per-file errors join into migrationsError, an evaluator crash degrades into migrationsError + assistedRequired instead of a failed result, and no evaluation runs when no update is available.
  • Progress emission — full step ordering including the byte-progress mapping, and the finally emit(null) contract on both success and failure paths.

All I/O boundaries are mocked (runCommand, settings, release store, evaluator) — nothing can touch real git/gh/network/~/.dispatch.

Validation

  • 7-mutant battery: 7/7 killed (channel selection, currentTag guard, both extra assistedRequired terms, finally-null, fallback filter, store-tag preference); source restored byte-identical.
  • pnpm run check ✅ · server unit suite 2390 passed / 8 skipped ✅ · web 541 ✅ · E2E 175 passed / 12 skipped ✅ · live lane 11 passed, zero leaked tmux sessions ✅
  • Review agent: 0 must-fix, 2 should-fix (applied: vi.resetAllMocks, fully-typed evaluator payloads via satisfies PendingMigrationsResult), nits applied.

🤖 Generated with Claude Code

…on fallback

apps/server/src/release-info.ts owned the assistedRequired classification
for the update path but had no direct tests (release-auto-check.test.ts
mocks it away). Adds 24 tests pinning the deriveCurrentTag store/semver
chain, stable-vs-latest channel selection with the gh-failure git-tag
fallback, updateAvailable classification, assisted metadata parsing
through the real release-metadata module (required/recommended/
appliesFrom/malformed-fence hard failure), pending-migration summary
mapping and evaluator-crash degradation, and progress emission ordering
with the finally-null contract. 7-mutant battery: 7/7 killed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 5525021 into main Aug 2, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_a058d66a445d/job-test-enforcer-f10effa1 branch August 2, 2026 02:18
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.

1 participant