Skip to content

Conversation

@HughParry
Copy link
Contributor

No description provided.

@HughParry HughParry requested a review from forgetso as a code owner January 20, 2026 13:31
Copilot AI review requested due to automatic review settings January 20, 2026 13:31
@HughParry HughParry requested a review from goastler as a code owner January 20, 2026 13:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a decision machine feature to the provider for enhanced behavioral detection. The decision machine allows customizable validation logic to be executed after CAPTCHA solutions are verified, enabling denial of requests based on behavioral data analysis.

Changes:

  • Added decision machine types, schemas, and database models
  • Implemented decision machine runner with sandboxed JavaScript execution
  • Integrated decision machine into POW CAPTCHA verification flow
  • Added admin API endpoint for updating decision machine configurations

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/types/src/decisionMachine/index.ts Defines core types, enums, and schemas for decision machine functionality
packages/types/src/provider/api.ts Adds API endpoint, request/response types, and rate limits for decision machine updates
packages/types/src/api/params.ts Adds API parameter enums for decision machine configuration
packages/types/src/api/api.ts Extends ProviderApiInterface with updateDecisionMachine method
packages/types/src/index.ts Exports decision machine module
packages/types-database/src/types/provider.ts Adds database schema and interface methods for decision machine artifacts
packages/provider/tsconfig.json Configures TypeScript paths for decision-machine package dependency
packages/provider/tsconfig.cjs.json Configures CommonJS TypeScript paths for decision-machine package
packages/provider/src/tasks/decisionMachine/decisionMachineRunner.ts Implements sandboxed execution of decision machine logic with timeout protection
packages/provider/src/tasks/client/clientTasks.ts Adds client task method for updating decision machine artifacts
packages/provider/src/api/admin/apiUpdateDecisionMachineEndpoint.ts Implements admin API endpoint for decision machine updates
packages/provider/src/api/admin/apiAdminRoutesProvider.ts Registers decision machine endpoint in admin routes
packages/provider/src/tasks/powCaptcha/powTasks.ts Integrates decision machine into POW CAPTCHA verification workflow
packages/database/src/databases/provider.ts Implements database operations for decision machine artifacts
packages/cli/src/RateLimiter.ts Adds rate limiting configuration for decision machine endpoint
packages/api/src/api/ProviderApi.ts Adds client method for calling decision machine update endpoint
packages/provider/src/tests/unit/tasks/decisionMachine/decisionMachineRunner.unit.test.ts Unit tests for decision machine runner
packages/provider/src/tests/unit/tasks/client/clientTasks.unit.test.ts Unit tests for decision machine task management
.changeset/orange-games-speak.md Changeset documenting the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@forgetso forgetso self-requested a review January 20, 2026 20:08
Copy link
Member

@forgetso forgetso left a comment

Choose a reason for hiding this comment

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

see comment regarding scope

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.

3 participants