Skip to content

[#1236] Rewrite airdrop config for v5 (PROD + test-fast + test-full)#1273

Merged
realproject7 merged 2 commits into
mainfrom
task/1236-airdrop-config-v5
May 26, 2026
Merged

[#1236] Rewrite airdrop config for v5 (PROD + test-fast + test-full)#1273
realproject7 merged 2 commits into
mainfrom
task/1236-airdrop-config-v5

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Summary

  • Rewrites lib/airdrop/config.ts with three-mode system: test-fast (5-min CI), test-full (30-min operator), prod (3-month campaign) — selected by NEXT_PUBLIC_AIRDROP_MODE env var
  • Test configs built lazily via getAirdropConfig(now) to avoid frozen-at-import timestamps
  • Adds CLAIM_WINDOW_DAYS (PROD=30) / CLAIM_WINDOW_SECONDS (test-fast=60, test-full=180) split with getClaimWindowSeconds() helper
  • Adds SIWE fields, referral multiplier params, milestone values per T0.1 approved spec
  • Updates PROD_CONFIG: pool 200K, milestones $100K/$1M/$5M/$10M, STREAK_BOOSTS: {}, campaign 3-month window
  • Adds pl_activations table type to lib/supabase.ts (11 columns per T0.2 migration)

Pending operator values

  • PLOTLINK_FC_FID: placeholder 0 — awaiting operator Farcaster FID (T0.1 action item [P0-2] Supabase Schema #2)
  • CAMPAIGN_START/CAMPAIGN_END: placeholder 2026-07-01/2026-10-01 — finalized at T5.2 launch prep

Backward compatibility

  • AIRDROP_CONFIG module-level const preserved — safe for PROD (static); test callers should migrate to getAirdropConfig(new Date())
  • Existing fields (POINTS, LOCKER_TX, STREAK_MIN_GAP_MINUTES) retained for current callers
  • AIRDROP_TEST_MODE removed (no external references)

Version

1.29.4 → 1.30.0 (feature)

🤖 Generated with Claude Code

Replace single test/prod toggle with three-mode system selected by
NEXT_PUBLIC_AIRDROP_MODE: test-fast (5-min CI smoke), test-full
(30-min operator multi-wallet), prod (3-month campaign).

Test configs are built lazily per call to avoid frozen-at-import
timestamps. Adds CLAIM_WINDOW_DAYS/SECONDS split, SIWE fields,
referral multiplier params, getClaimWindowSeconds helper, and
pl_activations table type for T0.2 migration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored May 26, 2026 4:52am

Request Review

@realproject7 realproject7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@re2 review — APPROVE ✅

Checked against issue #1236 acceptance criteria:

Criterion Status
PROD_CONFIG: CLAIM_WINDOW_DAYS: 30, no CLAIM_WINDOW_SECONDS
TEST_FAST: CLAIM_WINDOW_SECONDS: 60, no CLAIM_WINDOW_DAYS
TEST_FULL: CLAIM_WINDOW_SECONDS: 180, no CLAIM_WINDOW_DAYS
getClaimWindowSeconds() correct for all 3 configs
getClaimWindowSeconds() throws if neither field set
getAirdropConfig(now) builds test configs lazily (no frozen-at-import)
No fractional CLAIM_WINDOW_DAYS anywhere
STREAK_BOOSTS = {} in all configs
getAirdropMode() defaults to "prod" on unknown/unset env
pl_activations type added with 11 columns (Row/Insert/Update)
PlActivation type alias exported
Version bump 1.29.4 → 1.30.0 (feature level)

PROD_CONFIG values verified:

  • Pool 200K, milestones $100K/$1M/$5M/$10M, 3-month window (Jul–Oct 2026) ✅
  • SIWE fields (domain, URI, statement, chain 8453) ✅
  • Referral params (threshold 50, multiplier 0.2, cap 3.0) ✅
  • PLOTLINK_FC_FID: 0 placeholder noted ✅

Test configs verified:

  • test-fast: 5-min window (now-1m → now+4m), pool 10, threshold 1 ✅
  • test-full: 30-min window (now-1m → now+29m), pool 100, threshold 5 ✅
  • Both use buildTest*Config(now) for lazy timestamp generation ✅

Backward-compat:

  • AIRDROP_CONFIG module const preserved — safe for PROD (static), test callers must migrate to getAirdropConfig() per spec ✅
  • AIRDROP_TEST_MODE removed (issue confirms no external references) ✅

No issues found. Clean rewrite matching spec exactly.

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The main config shape matches much of #1236, but the PR leaves a production config value as a placeholder and omits the specific unit coverage required by the ticket for the new runtime helpers. Those are acceptance gaps for this config foundation PR.

Findings

  • [high] PLOTLINK_FC_FID is still hard-coded to 0 in the shared production/test SIWE config, even though #1236 depends on T0.1 and requires PLOTLINK_FC_FID: <from T0.1>. Shipping a real config with FID 0 risks downstream activation/follow verification targeting an invalid Farcaster account.

    • File: lib/airdrop/config.ts:60
    • Suggestion: Use the operator-approved FID from T0.1 before merging this config PR, or change the config contract so the missing value cannot be silently treated as a valid production FID.
  • [medium] The PR adds getAirdropConfig() and getClaimWindowSeconds() but does not add the unit tests explicitly required by #1236: all three claim-window conversions, throw behavior when neither window field exists, defaulting unknown/unset mode to prod, and lazy test config regeneration with two now values. Existing Vitest coverage is present in the repo, so these should be covered here.

    • File: lib/airdrop/config.ts:140
    • Suggestion: Add focused Vitest tests for getAirdropMode, getAirdropConfig, and getClaimWindowSeconds, including the 5-minute-apart lazy-window case for test-full.

Decision

Request changes. CI was still pending at review time, but these acceptance issues should be fixed regardless of the check result.

PLOTLINK_FC_FID now reads from NEXT_PUBLIC_PLOTLINK_FC_FID env var
(falls back to 0), so the operator can set it without a code change.
Adds unit tests for getAirdropMode, getAirdropConfig lazy rebuilds,
and getClaimWindowSeconds edge cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The requested-change items are addressed: the FID is no longer hard-coded in the config and the new Vitest coverage exercises the mode/default behavior, lazy test-window rebuilds, claim-window conversions, missing-window throw, and precedence. The rest of the config still matches #1236 acceptance: three modes, PROD/test claim-window split, empty streak boosts, and pl_activations typing.

Findings

  • No blocking findings.

Decision

Approve. lint-and-typecheck is passing; e2e was still pending at review time, so merge should still wait for required CI to complete. Note that NEXT_PUBLIC_PLOTLINK_FC_FID remains a launch prerequisite from T0.1 before any FC follow verification depends on it.

@realproject7
realproject7 merged commit e3fa1cd into main May 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants