Skip to content

feat(onboarding): pass a Captcha stage from the website - #423

Merged
kodiakhq[bot] merged 3 commits into
mainfrom
feat/onboarding-captcha
Nov 27, 2026
Merged

kodiakhq[bot] merged 3 commits into
mainfrom
feat/onboarding-captcha

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

Related to #418 and wolfstar-project/wolfstar.rocks#613. The website side follows in a wolfstar.rocks pull request that pins this contract.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The Captcha challenge was in the contract but blocked: the button answered that the stage is not available yet. The website checks the captcha, but only the bot gives the stage's role and writes OnboardingVerification. So the website needs a way to ask the bot to pass the member.

  • Contract. OnboardingRequest holds the guild, the user, the Waiting verification the page read, processedAt and error. The website inserts it with NOTIFY onboarding_request, '<id>' in the same transaction, as AppealRequest does. The migration is 20261127T1618_add_onboarding_requests.
  • Member. On a Captcha stage, the verification button now answers with a link button to /verify/<guild>. OnboardingNoticeButton is now an Action or a Link.
  • Bot. websiteNotifications starts a third RequestQueue, with a sweep for lost notifications. handleOnboardingRequest leases the request and checks, under the member's lock, that the row still waits at an enabled Captcha stage. Then it passes the member through passOnboardingStageLocked, the button's own path. A stage whose time ran out fails as the time limit job would fail it.
  • Outcome. The bot writes processedAt once. When it could not pass the member, it also writes error as <code>: <detail>, with the code off, notMember, stale, expired, roleRefused or failed.
  • Attempts. A refused captcha is not an attempt: only the time limit fails a Captcha stage.
  • Switch. OnboardingCaptchaAvailable is now true, so the panel offers Captcha.

Architecture of the Captcha path: the verification button links to the website, the website inserts an OnboardingRequest and notifies, the bot's listener queues it, and the handler passes the member and completes the request

🤖 AI disclosure: Wolfstar Agent Kit modified this description. AI open source policy.


Read this PR faster    Follow each request

Confidence Score: 5/5 · No new blocking issue was found in the bot-side changes.RetriggerView in GreptileConfidence Score: 5/5

No new blocking issue was found in the bot-side changes.

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

The website checks the captcha with Turnstile and inserts an
OnboardingRequest. The bot passes the member under their lock, as the
button of the verification message does, and writes why it could not.
@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
  • Redraw · drawn at 37954e4, the branch has moved on

Architecture

Walkthrough of Captcha stage verification via website and background requests, in four steps

Read this PR faster

Inside the changed components — 1 view

Component view — Onboarding verification

Internal components handling website captcha events and member progression.

Architecture view of Component view — Onboarding verification in wolfstar-project/wolfstar

Data flow

Data flow diagram for wolfstar-project/wolfstar at 37954e4

Follow each request


Data model

Data model diagram for wolfstar-project/wolfstar at 37954e4

Open the canvas


Tip

Open a diagram on the canvas, then press W or click play to walk through the change one step at a time

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues, one rough edge in the migration.

Approach: sound. The website cannot give the role or write OnboardingVerification, so a notified request row that the bot re-validates under the member's lock follows the AppealRequest and JoinGuardRequest pattern, with no new mechanism.

Reviewed changes: the full diff of the single commit (generated snapshots and ops.json skimmed only).

  • Contract and storage. OnboardingRequest table, migration 20261127T1618_add_onboarding_requests and the requests.ts helpers (fetchUnprocessedOnboardingRequest, completeOnboardingRequest as one conditional UPDATE, fetchPendingOnboardingRequestIds).
  • Request handling. handleOnboardingRequest leases the request, re-reads the row under the member lock, rejects stale rows, disabled stages and non-Captcha stages, fails an expired one as the time limit job would, and otherwise passes through passOnboardingStageLocked.
  • Wiring. onboarding_request channel, onboardingRequest shard message, a third RequestQueue in websiteNotifications, and the local and shard-manager targets.
  • Member side. The Captcha branch of the verification button now answers with a link button to /verify/<guild>, and OnboardingNoticeButton is an Action | Link union. OnboardingCaptchaAvailable is now true.
  • Tests and docs. Handler, render and listener tests, and the AGENTS.md onboarding entry.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-sonnet-5-5 | 𝕏

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.90566% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.05%. Comparing base (5e0fa75) to head (2600f3a).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
projects/bot/src/lib/onboarding/requests.ts 85.36% 4 Missing and 2 partials ⚠️
projects/bot/src/lib/database/website.ts 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #423      +/-   ##
==========================================
+ Coverage   62.88%   63.05%   +0.17%     
==========================================
  Files         287      288       +1     
  Lines       10246    10295      +49     
  Branches     2456     2470      +14     
==========================================
+ Hits         6443     6492      +49     
+ Misses       3367     3365       -2     
- Partials      436      438       +2     
Flag Coverage Δ
unit 63.05% <84.90%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

A request swept after the member left and joined again passed or failed
them on the row of the stay that ended. The member is now read under
their lock, and the sweep reads the pending requests by a partial index.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes: the one new commit since the last pullfrog review (ad2ce5b), which also folds in the migration fix.

  • Current-stay check. handleOnboardingRequest now refuses a row older than the member's current join (selectCurrentStay([verification], member.joinedTimestamp)), answering stale, so a queued request of an earlier stay cannot pass a member who left and rejoined. This is the same check members.ts uses for leave handling.
  • Member fetch under the lock. fetchOnboardingMember moved inside withOnboardingMemberLock, so the join timestamp is read in the same critical section as the verification row.
  • Pending index. The migration now creates OnboardingRequest_created_at_pending_idx (created_at where processed_at IS NULL) through rawSql, with ops.json and the migration hash updated; this resolves the earlier thread.
  • Tests. A new case covers a row of an earlier stay (no pass, no fail, stale written); the shared member fixture gets joinedTimestamp: null.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 27, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Review Approved in Wolfstar Nov 27, 2026
# Conflicts:
#	projects/database/migrations/app/refs/db.json
@kodiakhq
kodiakhq Bot merged commit 8a0e422 into main Nov 27, 2026
23 of 25 checks passed
@kodiakhq
kodiakhq Bot deleted the feat/onboarding-captcha branch November 27, 2026 17:25
@github-project-automation github-project-automation Bot moved this from Review Approved to Done in Wolfstar Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant