fix: release QA hardening across processing, media, security, and CI gates (#649)

A release-readiness QA pass over the whole product. The commits split into
defects a user would hit and gates that were reporting green while measuring
nothing.

## Fixes that change behaviour

Rate limiting was bypassable on every install: TRUST_PROXY defaulted to true, so
request.ip came from a client-set header and a forged X-Forwarded-For got past
the login limiter. The default is now a private-network trust list.

A transient Postgres outage stranded in-flight jobs, leaving finished output on
disk with no row pointing at it. A reconciler now resolves those rows and adopts
the bytes rather than dropping the work.

A Redis connection that moved to a new address wedged every read-blocked
consumer, so completions stopped signalling while health still answered 200.
Socket timeouts plus subscriber pings recover it.

Installing more than one AI bundle left the shared venv multi-versioned and
silently broke three tools. The installer now reconciles distributions to one
version each.

Converting an image to JXL at quality 1 through 4 returned a 500, because
libjxl 0.7 rejects the distance those values compute. The quality is floored at
what the encoder honours. A missing ffmpeg was also reported to the user as a
corrupt upload; it now says the engine is unavailable.

RAW uploads reached an unpatched LibRaw on arm64, so it is built from source at
0.22.2, and the release scan was split so it can fail on an unfixed critical
instead of hiding it behind ignore-unfixed.

## Gates that could not fail

Two mutation lanes ran zero mutants because Stryker crawled the gitignored docs
build; coverage discarded its whole report on any failing test; the lint gate
skipped root tests, scripts, and two workspaces; and several generated matrices
counted a host missing ffmpeg as a passing tool. Each now measures what it
claims.

Full evidence and the outstanding release items are tracked locally and are not
part of this branch.
This commit is contained in:
SnapOtter
2026-07-27 15:37:30 +08:00
committed by GitHub
parent bc32f86a07
commit d10d0f544f
855 changed files with 54564 additions and 13092 deletions
+25 -2
View File
@@ -8,16 +8,24 @@
set -euo pipefail
VERSION="${1:?Usage: sync-version.sh <version>}"
if [[ ! "$VERSION" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
echo "Invalid semantic version: $VERSION" >&2
exit 2
fi
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
# All workspace package.json files to sync
PACKAGES=(
"apps/web/package.json"
"apps/api/package.json"
"apps/demo/package.json"
"apps/docs/package.json"
"apps/landing/package.json"
"packages/shared/package.json"
"packages/doc-engine/package.json"
"packages/enterprise/package.json"
"packages/image-engine/package.json"
"packages/media-engine/package.json"
"packages/ai/package.json"
)
@@ -45,7 +53,22 @@ if [ -f "$CONSTANTS" ]; then
echo " Updated APP_VERSION -> $VERSION"
fi
# Clean up release notes file (consumed by CI, not needed after release commit)
rm -f "$ROOT/.release-notes.md"
# Keep the release-specific commands in every published documentation locale
# aligned with the tag and immutable artifact names created by this release.
node "$ROOT/scripts/sync-published-docs-version.mjs" "$VERSION"
# Archive optional custom notes under their immutable release version before the
# semantic-release git plugin commits and tags them. This makes a tag-only retry
# able to reconstruct the exact draft body and published docs changelog.
node "$ROOT/scripts/manage-release-notes.mjs" archive "$VERSION" --root "$ROOT" >/dev/null
if [ -f "$ROOT/.release-notes/v$VERSION.md" ]; then
PREVIOUS_TAG="$(git -C "$ROOT" describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || true)"
if [[ ! "$PREVIOUS_TAG" =~ ^v(.+)$ ]]; then
echo "Cannot update the published changelog without a previous release tag" >&2
exit 1
fi
node "$ROOT/scripts/manage-release-notes.mjs" sync-docs "$VERSION" "${PREVIOUS_TAG#v}" \
--root "$ROOT" >/dev/null
fi
echo "All versions synced to $VERSION"