Skip to content

feat(perps): add headless recipe v1 controller example - #8955

Merged
abretonc7s merged 4 commits into
feat/perps-e2e-validationfrom
feat/perps-recipe-v1
Jun 1, 2026
Merged

feat(perps): add headless recipe v1 controller example#8955
abretonc7s merged 4 commits into
feat/perps-e2e-validationfrom
feat/perps-recipe-v1

Conversation

@abretonc7s

@abretonc7sabretonc7s commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Closing this draft because the shape is too intrusive for core.

The correct direction is to keep MetaMask core as a minimal consumer of a reusable Farmslot headless recipe harness instead of embedding a full runner under packages/perps-controller/recipe-v1.

Target replacement shape:

  • publish/consume @farmslot/protocol + @farmslot/recipe-harness as dev dependencies;
  • keep only a small action manifest + recipe JSON in core;
  • use the standard farmslot-recipe CLI for generic headless command/assert/artifact handling;
  • if PerpsController-specific coverage is needed, add a tiny package-owned smoke script that calls controller public methods and prints JSON, not a bespoke runner;
  • avoid protocol-versioned folder names and broad eslint/tsconfig churn.

This draft is preserved only as a reference for what not to ship.

@abretonc7s
abretonc7s marked this pull request as ready for review June 1, 2026 15:26
@abretonc7s
abretonc7s requested review from a team as code ownersJune 1, 2026 15:26
@abretonc7s
abretonc7s merged commit b113454 into feat/perps-e2e-validationJun 1, 2026
15 of 16 checks passed
@abretonc7s
abretonc7s deleted the feat/perps-recipe-v1 branch June 1, 2026 15:26

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 99f5db1. Configure here.

return value;
}
return `${value.slice(0, MAX_OUTPUT_BYTES)}\n…[truncated]`;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Truncate checks bytes but slices by characters

Low Severity

The truncate function gates on Buffer.byteLength (a byte-based measure) but then truncates using String.prototype.slice (a character-based operation). For multi-byte UTF-8 strings, a string can have fewer characters than MAX_OUTPUT_BYTES yet more bytes — in that case slice(0, MAX_OUTPUT_BYTES) returns the entire original string unchanged, and the \n…[truncated] suffix is appended, making the output longer than the input while still exceeding the byte budget.

Fix in CursorFix in Web

Reviewed by Cursor Bugbot for commit 99f5db1. Configure here.

Sign up for freeto 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.

1 participant

@abretonc7s