Skip to content

Conversation

@derekpierre
Copy link
Member

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:

taco-web implementation of work done in nucypher/nucypher#3658.

Issues fixed/closed:

  • Fixes #...

Why it's needed:

Explain how this PR fits in the greater context of the NuCypher Network. E.g.,
if this PR address a nucypher/productdev issue, let reviewers know!

Notes for reviewers:

What should reviewers focus on? Is there a particular commit/function/section
of your PR that requires more attention from reviewers?

@derekpierre derekpierre self-assigned this Oct 2, 2025
@derekpierre derekpierre changed the title [WIP] Define Variable/Value operations before evaluation [WIP] Define Variable/Value operations that will be used before evaluation Oct 2, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 99.00990% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (signing-epic@ba44142). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...o/src/conditions/schemas/export-for-zod-doc-gen.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##             signing-epic     #723   +/-   ##
===============================================
  Coverage                ?   89.19%           
===============================================
  Files                   ?       95           
  Lines                   ?     8042           
  Branches                ?      505           
===============================================
  Hits                    ?     7173           
  Misses                  ?      829           
  Partials                ?       40           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@derekpierre derekpierre mentioned this pull request Oct 2, 2025
23 tasks
@derekpierre derekpierre changed the title [WIP] Define Variable/Value operations that will be used before evaluation Define Variable/Value operations that will be used before evaluation Oct 3, 2025
@derekpierre derekpierre requested a review from Copilot October 3, 2025 02:17
Copy link

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 implements variable/value operations that can be performed before evaluation in the TACO web package, following the work done in the referenced nucypher PR. The implementation adds support for mathematical and type conversion operations that can be applied to condition variables and return values.

Key changes:

  • Added a comprehensive set of operation functions including arithmetic, aggregation, and type conversion operations
  • Implemented schema validation for variable operations with proper value requirement handling
  • Integrated operations into sequential conditions and return value tests

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/taco/src/conditions/schemas/variable-operation.ts Core implementation defining operation types and validation schema
packages/taco/src/conditions/schemas/sequential.ts Added operations field to condition variables
packages/taco/src/conditions/schemas/return-value-test.ts Added operations field to return value tests
packages/taco/test/conditions/variable-operation.test.ts Comprehensive test suite for operation validation
packages/taco/test/conditions/sequential.test.ts Added tests for operations in sequential conditions
packages/taco/test/conditions/return-value-test.test.ts Added tests for operations in return value tests
packages/taco/integration-test/encrypt-decrypt.test.ts Integration test demonstrating operations usage
packages/taco/integration-test/condition-lingo.test.ts Extended integration tests with operations and increased timeout

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@derekpierre derekpierre marked this pull request as ready for review October 3, 2025 02:18
…e to possible expensive nature of operation and possible ddos vector.
Copy link
Contributor

@Muhammad-Altabba Muhammad-Altabba left a comment

Choose a reason for hiding this comment

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

LGTM!
🚀

Copy link
Member

@manumonti manumonti left a comment

Choose a reason for hiding this comment

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

LGTM! I left a question though


| Property | Type |
| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`operation`** (\*) | `'+=' \| '-=' \| '*=' \| '/=' \| '%=' \| '^=' \| 'index' \| 'round' \| 'abs' \| 'avg' \| 'ceil' \| 'ethToWei' \| 'floor' \| 'len' \| 'max' \| 'min' \| 'sum' \| 'weiToEth' \| 'bool' \| 'float' \| ...` |
Copy link
Member

Choose a reason for hiding this comment

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

in nucypher#3658 we also have 'int' and 'str'. Should we add them here?

Copy link
Member

Choose a reason for hiding this comment

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

or is this automatically generated? 🧐

Copy link
Member Author

Choose a reason for hiding this comment

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

That is produced by a script and seems like it can only provide a certain number of operations in the list and it is getting truncated to '...'.

cc @Muhammad-Altabba - we can address that truncation separately.

Copy link
Member

Choose a reason for hiding this comment

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

got it. Thanks

Copy link
Member Author

Choose a reason for hiding this comment

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

Filed #727 (cc @Muhammad-Altabba)

@derekpierre derekpierre merged commit 0767bf1 into nucypher:signing-epic Oct 15, 2025
4 of 10 checks passed
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.

5 participants