Work

QWED-AI/qwed-ucp: TrustStatus, New Guards, Middleware Hardening & CI Pipelines

Year: 2026
Type: software
Abstract: Released: July 19, 2026 81 commits, 40 files changed (+4088/-209 lines) since v0.2.0 (Jan 2026). What's new TrustStatus enum — Replaced the ambiguous verified: bool with a 7-state TrustStatus enum (VERIFIED, FAILED, UNVERIFIABLE, BLOCKED, QUARANTINED, PARTIAL, ENGINE_ERROR) across all 12 result dataclasses. Includes reconcile_trust_status() and aggregate_status() helpers with severity ordering. Fail-closed default: verified=False maps to FAILED. New guards: RefundGuard — Validates full/partial refund amounts, percentage vs fixed, tax reversals, and ensures refund ≤ original total TipGuard — Percentage/post-tax tip verification with configurable bounds FeeGuard — Service/delivery/platform fee calculation with distance-based and percentage models AttestationGuard — Sign/verify checkout attestations with nonce-based replay protection, context binding, and audit chain receipts CurrencyGuard — 3-letter ISO currency validation with zero-decimal currency support (JPY, etc.) and conversion checks LineItemsGuard — Line item subtotal reconciliation against declared totals Middleware (fail-closed by default): FastAPI middleware — Blocks requests before the handler runs (call_next), rejects empty/malformed/non-dict bodies with 422 UNPARSEABLE_REQUEST, internal errors return 500 INTERNAL_VERIFICATION_ERROR Express middleware — npm package now includes qwd-ucp-middleware.js in published files array. Fire-and-forget callbacks (no hanging), synchronous throws isolated via .then().catch(), cognitive complexity reduced from 18 to ~7 Security hardening: Path injection sandbox (_safe_resolve) constrains GitHub Action file paths to $GITHUB_WORKSPACE uv.lock with 26 pinned packages + hashes, enforced via uv sync --frozen in Dockerfile PyJWT CVE fix, log sanitization, Dockerfile vulnerability reductions SHA-pinned GitHub Actions across all workflows CI/CD pipelines: CircleCI — Test matrix (3.10/3.11/3.12), ruff lint, pip-audit security scan Buildkite — Test matrix via Docker plugin, ruff lint, pip-audit security scan Main branch protection (required checks: lint, test matrix, QWED Security, SonarCloud) Infrastructure: Published uv.lock for deterministic dependency resolution Pinned uv to 0.11.29 (replaces :latest) Express middleware npm package now publishable (entrypoint included) Breaking changes TrustStatus replaces verified: bool semantics — All result dataclasses now carry a .status field. GuardResult(verified=True) auto-sets status=TrustStatus.VERIFIED. Explicit status takes precedence. Unknown status values raise ValueError. Legacy verifier fail-closed — verified=True no longer returned when required verification inputs are missing Dockerfile entrypoint — Changed from /action_entrypoint.py to /app/action_entrypoint.py (already under /app via COPY . /app) Out of scope (tracked separately) 15 open issues (5 High, 10 Medium) — pre-existing bugs and feature gaps VERIFIED path for CrossHair symbolic execution (Fares Ibrahim's PR #212 in qwed-verification)
Institution: Snyk Limited
Language: English
Open Access status: green
OpenAlex ID: W7124883765
Cites:
Cited by:
Related to: 10