-
Notifications
You must be signed in to change notification settings - Fork 8
Feat/decision machine #2362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/decision machine #2362
Conversation
There was a problem hiding this 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.
packages/provider/src/tasks/decisionMachine/decisionMachineRunner.ts
Outdated
Show resolved
Hide resolved
…ner.ts Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
forgetso
left a comment
There was a problem hiding this 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
No description provided.