Skip to content

chore(release): promote dev to main - #874

Merged
JOY (JOY) merged 19 commits into
mainfrom
dev
Oct 24, 2026
Merged

JOY (JOY) merged 19 commits into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Promote dev to main.

Merge with a merge commit, never squash (Docs/Resources/RELEASE.md).


📌 TL;DR

This PR implements comprehensive input validation, sanitization, and resource bounding across the browser extension and importer services to prevent security vulnerabilities (e.g., XSS, credential leakage, prototype pollution) and performance degradation (e.g., ReDoS, memory exhaustion). It also introduces operational scripts for automated release management and updates CI/CD workflows to test these new safeguards.

🎯 Type of Change

  • 🚀 New feature
  • 🐛 Bugfix
  • 🧹 Refactor
  • ⚡ Performance
  • 📚 Documentation
  • ⚙️ CI / Configuration

🔍 Changes Walkthrough

File Summary of Changes
.github/workflows/ci.yml Added a new CI step to run tests for the new operational scripts (merge-when-green, board, promote, verify-live).
AGENTS.md Updated agent documentation to include instructions for using the new scripts/ops/ utilities for merging, promoting, verifying live status, and managing project boards.
Docs/Resources/RELEASE.md Updated release documentation to reflect the new automated workflows provided by promote.mjs and verify-live.mjs.
apps/extension/src/extractors/ecommerce-detector.ts Hardened URL parsing by rejecting URLs with embedded credentials, control characters, or excessive length. Added bounds to ID extraction (max length) and JSON-LD processing (max entities/offers) to prevent resource exhaustion.
apps/extension/src/security-guards.ts Enhanced sanitization of product signals (URLs, IDs, titles) to strip control characters and validate formats. Added bounds to sparkline data points. Updated escapeSafeExternalHref to reject credential-embedded URLs.
apps/extension/src/test-extension-pipeline.ts Added extensive test cases for the new security guards, URL sanitization, ID bounds, and JSON-LD limits.
apps/importer/src/shopee/__tests__/backfill-review-risk.test.ts Added tests for vocabulary validation, follower count ceilings, key spec sanitization, retry delay bounds, sensitive string redaction, and circular reference handling in logs.
apps/importer/src/shopee/__tests__/paging.test.ts Added tests for rejecting URLs with credentials, zero IDs, oversized IDs, and clamping page sizes.
apps/importer/src/shopee/ai-review-analyzer.ts Hardened configuration parsing (URL validation, timeout clamping). Sanitized AI-generated text (pros/cons/summary). Validated review verdicts and flag categories against allowed sets. Added input validation for review votes.
apps/importer/src/shopee/arena-spec-syncer.ts Added bounds to HTML processing (max length, max catalog items). Hardened URL normalization to reject credentials.
apps/importer/src/shopee/cluster-peer-floor.ts Added bounds to peer row processing (max rows). Hardened price validation to reject booleans and non-finite numbers.
apps/importer/src/shopee/entity-matcher.ts Added bounds to image list processing (max images). Hardened URL sanitization to reject credentials.
apps/importer/src/shopee/jobs/backfill-specs.ts Implemented robust sanitization for key specs: stripping control characters, validating keys (rejecting __proto__, constructor, etc.), bounding string lengths and object keys.
apps/importer/src/shopee/logger.ts Enhanced redactSensitiveString to cover more secret patterns (API keys, tokens) and bound output length. Rewrote sanitizeLogMeta to handle circular references, bound depth/keys, and redact sensitive data more effectively.
apps/importer/src/shopee/merchant-review-risk.ts (Truncated in diff, but implied by tests) Hardened merchant scoring logic to handle overflowed follower counts and invalid inputs.

📊 Architectural Flow

flowchart TD
    subgraph "Browser Extension"
        A[Raw Product Signal] --> B[security-guards.ts]
        B -->|Sanitize URL/ID/Text| C[Cleaned Signal]
        C --> D[ecommerce-detector.ts]
        D -->|Validate & Extract| E[Final Product Data]
    end

    subgraph "Importer Service"
        F[Raw HTML/JSON Data] --> G[arena-spec-syncer.ts]
        G -->|Bound HTML/Items| H[Specs]
        I[Merchant/Review Data] --> J[merchant-review-risk.ts]
        J -->|Validate & Score| K[Risk Scores]
        L[Log Data] --> M[logger.ts]
        M -->|Redact & Sanitize| N[Safe Logs]
    end

    subgraph "Ops Scripts"
        O[CI Green] --> P[merge-when-green.mjs]
        P --> Q[Promote PR]
        R[Main Branch] --> S[verify-live.mjs]
        S -->|Check Health/Commit| T[Live Status]
    end
Loading

JOY (JOY) and others added 19 commits October 24, 2026 16:49
) (#839)

* fix(importer): clamp fetchAllPages bounds and harden merchant risk (#838)

* fix(importer): require pageSize and maxPages >= 1 in fetchAllPages (#838)

---------

Co-authored-by: JOY <anh@metados.com>
…eKeySpecs (#840) (#841)

* fix(importer): harden computeRetryDelayMs, logger redaction, and mergeKeySpecs (#840)

* fix(importer): redact depth-5 leaves, preserve DAG refs, and scan boundary secrets (#840)

---------

Co-authored-by: JOY <anh@metados.com>
…oken parsing (#842) (#843)

* fix(web): harden cache-tags targets, api-handler bounds, and cookie token parsing (#842)

* fix(web): allow composite platform:shopId merchant identifiers in cache tags (#842)

---------

Co-authored-by: JOY <anh@metados.com>
…d bounds (#844) (#845)

Co-authored-by: JOY <anh@metados.com>
… sitemap bounds (#850) (#851)

Co-authored-by: JOY <anh@metados.com>
…d i18n (#852) (#853)

Co-authored-by: JOY <anh@metados.com>
… and spec-localizer (#854) (#855)

Co-authored-by: JOY <anh@metados.com>
…d rate-i18n bounds (#856) (#857)

Co-authored-by: JOY <anh@metados.com>
…d openapi origin bounds (#860) (#861)

Co-authored-by: JOY <anh@metados.com>
…rowd ingest URLs (#864) (#866)

Co-authored-by: JOY <anh@metados.com>
#859 sliced each cluster to its first 200 offers before computing the
market min, median, max and spread. Offers arrive sorted by price, so a
product with more than 200 offers lost its priciest listings and its
spread (the catalog E2E "reads page past the 1000-row cap" saw 0 and
has failed on dev since). Drop the per-cluster slice; keep the cluster
cap and option normalisation from #859. Guard: a 250-offer cluster with
the priciest offer last still reports it.

Co-authored-by: JOY <anh@metados.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… revalidate tokens (#868) (#872)

Co-authored-by: JOY <anh@metados.com>
) (#870)

* feat(ops): commit agent release helpers and report the live commit (#865)

Agents merged, promoted, updated Project #9 and verified releases with
copy-paste commands or helpers kept only in a session scratchpad. On
2026-10-24 a production redeploy took a deployment older than main and
briefly rolled back a release (#814).

- scripts/ops/merge-when-green.mjs: merge once the head's checks pass,
  pinned to the head SHA; PRs into main always use a merge commit.
- scripts/ops/board.mjs: set Project #9 status and agent plus the
  status:*/agent:* labels in one command.
- scripts/ops/promote.mjs: open or reuse the dev to main PR with the
  released PRs listed, then merge it with a merge commit when green.
- scripts/ops/verify-live.mjs: check the live commit equals main, the
  database is readable and the main routes answer 200; on a mismatch,
  print the production deployment built from main as the only redeploy
  source.
- /api/health reports `commit` (VERCEL_GIT_COMMIT_SHA, null off Vercel).
- Unit tests run in CI; AGENTS.md and RELEASE.md point to the scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ops): address review of the release helpers (#865)

- verify-live re-reads main every poll and suggests a fix only when the
  live commit is behind main (compare live...main); it never suggests
  rolling a newer or diverged deployment back. The fix it prints is
  `vercel promote` of main's production deployment, not a redeploy.
- merge-when-green also gates on commit statuses (Vercel), reads the
  required checks from the branch rules, paginates check runs, encodes
  the branch ref, validates the merge method before waiting, tolerates
  transient API errors and takes --ignore for a known-broken check.
- promote never reuses a fork's dev PR, refreshes a reused PR's body and
  counts unnumbered commits correctly.
- board writes labels first, adds the assignee and replaces another
  agent's claim label on a hand-over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ops): never take another agent's issue silently; harden waits (#865)

Round-2 review of #870:
- board refuses an issue claimed by another agent unless --take-over is
  passed (AGENTS.md section 1), and prints the claim it replaces.
- merge-when-green rejects an --ignore of a required check, re-derives
  the merge method each poll and retries a brief merge refusal after a
  fresh read.
- promote edits a reused PR's body only when it changed (an edit re-runs
  the PR-base check).
- verify-live survives a transient error re-reading main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: JOY <anh@metados.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@vercel

vercel Bot commented Oct 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
rate Ready Ready Preview Oct 24, 2026 3:10pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b17720dd-d52c-4a61-8cef-bfb8236c1517

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added ci CI/CD workflows and pipelines docs Documentation changes area:frontend Frontend / Next.js / UI area:crawlers area:extension labels Oct 24, 2026
@JOY
JOY (JOY) merged commit 0aceebf into main Oct 24, 2026
21 checks passed

This branch was successfully deployed

1 active deployment
Preview — afbe1f56 Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:crawlers area:extension area:frontend Frontend / Next.js / UI ci CI/CD workflows and pipelines docs Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant