fix(audit): correct semverCompare + drift/probe robustness + scaffold finalize safety#52
Merged
Conversation
… finalize safety Service-engine quality fixes from the portfolio quality audit (113/113 tests, +13): audit engine: - [CRITICAL] semverCompare (audit-helpers.ts): reimplemented to SemVer §11 — a release now ranks ABOVE its own prerelease (1.0.0 > 1.0.0-rc.3, was inverted) and build metadata is ignored (§10). New tests/audit-helpers.test.ts covers release>prerelease, build-metadata equality, numeric-vs-alpha + numeric-field prerelease ordering, and the non-semver fallback. - [MAJOR] audit-cd.ts: each probe body wrapped so one malformed payload (version as a JSON number) can't abort the whole multi-destination audit; prerelease-only npm packages no longer reported not-found; github-releases tag SemVer-extracted (no phantom drift on scoped/monorepo tags); placeholder package/AMO ids reported as template-not-configured. - [MAJOR] audit.ts: count all commits since last tag (not only PR-annotated), so rebase-merge repos no longer falsely report READY; issue-close #N refs excluded from the PR set. - [MAJOR] cli.ts: operational/infra failures exit 2 (distinct from result-failure exit 1); audit/seed reject unknown flags instead of silently dropping them. scaffold/download: - [CRITICAL] scaffold.ts finalize: re-check finalDest is still absent/empty IMMEDIATELY before the destructive rm (TOCTOU data-loss); preserve a built workDest on rename failure; longest-key-first replacement so substrings aren't mangled. Honest comment that the window is not truly atomic. - [MINOR] download.ts maxRetries<=0 clamped; version.ts warns before the 0.0.0 sentinel; seed-security-guidance populates matchedStarter in the exists branch. build + lint clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Service-engine quality fixes from the portfolio quality audit (113/113 tests, +13):
audit engine:
a release now ranks ABOVE its own prerelease (1.0.0 > 1.0.0-rc.3, was inverted)
and build metadata is ignored (§10). New tests/audit-helpers.test.ts covers
release>prerelease, build-metadata equality, numeric-vs-alpha + numeric-field
prerelease ordering, and the non-semver fallback.
as a JSON number) can't abort the whole multi-destination audit; prerelease-only
npm packages no longer reported not-found; github-releases tag SemVer-extracted
(no phantom drift on scoped/monorepo tags); placeholder package/AMO ids reported
as template-not-configured.
rebase-merge repos no longer falsely report READY; issue-close #N refs excluded
from the PR set.
exit 1); audit/seed reject unknown flags instead of silently dropping them.
scaffold/download:
IMMEDIATELY before the destructive rm (TOCTOU data-loss); preserve a built
workDest on rename failure; longest-key-first replacement so substrings aren't
mangled. Honest comment that the window is not truly atomic.
sentinel; seed-security-guidance populates matchedStarter in the exists branch.
build + lint clean.