You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(importer): reject --audit-only combined with --apply in backfill-specs #1854
Ensure apps/importer/src/shopee/jobs/backfill-specs.ts fails closed when --audit-only is passed together with --apply, preserving the documented read-only contract of --audit-only and preventing unscoped writes across every FLAGSHIP_DEVICES_TO_SEED master row.
Requirements
backfill-specs.ts documents --audit-only (around line 10) as a read-only mode (Run quick spec audit without writing) and parseBackfillSpecsArgs already rejects --audit-only combined with --only or --expect (lines 581-590).
Currently parseBackfillSpecsArgs(["--audit-only", "--apply"]) succeeds and main() (lines 1321-1322) invokes runQuickSpecSyncAndAudit({ apply: true }), which upserts all seeded flagship devices in rate.master_products without requiring --only or --expect scope guards!
Update parseBackfillSpecsArgs so combining --audit-only and --apply throws a clear validation error before any Supabase client or query runs.
Add a defensive check at the entry of runQuickSpecSyncAndAudit or main so --audit-only never executes apply: true.
Approach
Add the mutual-exclusion check in parseBackfillSpecsArgs (matching the existing --audit-only + --only/--expect error style) and cover both flag orders (["--audit-only", "--apply"] and ["--apply", "--audit-only"]) in backfill-specs-scope.test.ts.
Acceptance
parseBackfillSpecsArgs(["--audit-only", "--apply"]) and parseBackfillSpecsArgs(["--apply", "--audit-only"]) throw a descriptive error and never return { auditOnly: true, apply: true }.
Valid invocations (["--audit-only"], ["--apply", "--only=...", "--expect=1"], dry-run defaults) continue to work unchanged.
Unit tests in apps/importer/src/shopee/__tests__/backfill-specs-scope.test.ts and monorepo CI checks pass.
[Agent: Ops] Claimed #1854 on branch fix/1854-backfill-audit-only-guard (Claimant: antigravity:cd885866-827d-4dee-8251-1d84c244e27f). Implementing mutual exclusion for --audit-only + --apply in backfill-specs.ts and unit tests in backfill-specs-scope.test.ts.
🔓 [Agent: Ops] Claim lock refs/claims/1854 of antigravity:cd885866-827d-4dee-8251-1d84c244e27f (Agent Ops) since 2026-11-22T09:47:53Z released by claimant antigravity:def296a6-5f67-48da-bb74-ee3ede4b7061 because #1854 is closed (Status: done).
Activity
JOY commentedon Nov 22, 2026
🔒 [Agent: Ops] Claim lock
refs/claims/1854taken by claimantantigravity:cd885866-827d-4dee-8251-1d84c244e27f(Status: in-progress).JOY commentedon Nov 22, 2026
[Agent: Ops] Claimed #1854 on branch
fix/1854-backfill-audit-only-guard(Claimant:antigravity:cd885866-827d-4dee-8251-1d84c244e27f). Implementing mutual exclusion for--audit-only+--applyinbackfill-specs.tsand unit tests inbackfill-specs-scope.test.ts.JOY commentedon Nov 22, 2026
[Agent: Ops] Opened PR #1856 (
fix/1854-backfill-audit-only-guard->dev, commitcaf488e0). Local test/typecheck/lint/build/dist checks passed; running 2 independent fresh-context reviews and CI checks.fix(importer): make runQuickSpecSyncAndAudit strictly read-only
fix(importer): reject --audit-only with --apply in backfill-specs (#1856
JOY commentedon Nov 22, 2026
🔓 [Agent: Ops] Claim lock
refs/claims/1854of antigravity:cd885866-827d-4dee-8251-1d84c244e27f (Agent Ops) since 2026-11-22T09:47:53Z released by claimantantigravity:def296a6-5f67-48da-bb74-ee3ede4b7061because #1854 is closed (Status: done).