Repository navigation
0.23.0: credit codes, invites and ?ref= links - #326
Merged
Merged
Conversation
A code (AJ-XXXX-XXXX-XXXX-XXXX, stored only as a hash) grants credit in US cents, redeemed on /me, over the API, the CLI or MCP (@profullstack/redeem-credits). Every account gets three single-use /i/<code> invites at /invites plus one open ?ref= link (@profullstack/affiliates). - The invite and ref ride on the magic link, so a link opened in another browser still counts, and they apply only when that link makes a new account (the address is confirmed by construction). - An accepted invite pays both sides INVITE_BONUS_CENTS (default 100) unless the two addresses are one mailbox, the inviter's account is younger than INVITE_MIN_INVITER_AGE_HOURS (default 24), or the inviter has had ten bonuses in 30 days. invite_bonuses claims the row before the grant, so a retry never pays twice. - /i/ is open past the crawl gateway; links are built from PUBLIC_URL, or the request host when that is still localhost. - Operator: agenticjobs credits mint|list|revoke against DATABASE_URL; admin POST /api/v1/admin/credit-codes from a browser session. - The board charges no listing fee or commission, so nothing spends credit yet. - api.test: retry an agent path once when a parallel test hid the agent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Credit codes and invites on agenticjobs.work, from the house packages
@profullstack/redeem-credits@^0.2.0and@profullstack/affiliates@^0.2.0over the board's Postgres (postgresStore).What a code grants
AJ-XXXX-XXXX-XXXX-XXXXcodes grant credit in US cents (usd_cents). They are stored only as a sha256 hash. You can redeem one:/me, in the new Credit card ("Have a code?"),POST /api/v1/credits/redeem {code},agenticjobs redeem <code>,redeem_credit_code.The balance and its history are at
GET /api/v1/credits,agenticjobs creditsand the MCP toolcredits.Spending: the board charges no listing fee and no commission (
/post-a-job). "$0.25 per task" is an example pay line an employer writes. It is not a board price. Invoices settle on CoinPay straight to the payee's wallet. So no payment path exists for credit to pay through. Credit is held on the account, and the card says so. What credit should buy is a decision for Anthony.Minting (operator):
An admin with a browser session can also call
POST /api/v1/admin/credit-codes. A device token cannot.Invites
/invitesgives each account 3 single-use invites. Each one is good for 30 days and is shown once as/i/<code>. The page also has an open?ref=link./i/<code>stores the code in a cookie and points to/signup?invite=. It is open past the crawl gateway (openPaths), so link previews don't hit a 402. Visiting it uses nothing up.The invite and the ref ride on the magic link (new
magic_links.invite_code/ref_code). The invite still counts when the link is opened in another browser. It applies only when spending that link creates a new account, which means the address is confirmed.Bonus: both sides get
INVITE_BONUS_CENTS(default 100; 0 turns it off). There is no bonus when:INVITE_MIN_INVITER_AGE_HOURS(default 24),Each case is recorded in
invite_bonuses. The row is claimed before the grant, so a retry never pays twice.?ref=is first-touch. It is stored in thereferral_codecookie (the @profullstack/referrals name, so nothing double counts if that package is added later) and recorded inaff_attributionsat sign-up. The board has no referrals program today.API:
GET/POST /api/v1/invites. CLI:agenticjobs invites [create --note]andagenticjobs signup --invite <code>. MCP:credits {invites|createInvite}.Links are built from
PUBLIC_URL, or from the request host if that is still localhost.Migration
0025_credits_and_invites.sqlruns at boot, as all migrations do. It adds thecredit_*tables, twomagic_linkscolumns andinvite_bonuses. Theaff_*tables are created by the package on first use.Tests
test/credits-invites.test.tscovers:?ref=The full suite passes 1018/1018 on a fresh Postgres 17, run 3 times.
api.test"every documented GET path resolves" racedfeatures.test, which hides and deletes agents. It now re-reads the directory once before failing.🤖 Generated with Claude Code