Skip to content
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

Add support for arbitrary input for prompts #422

Closed
danmatichuk opened this issue Jul 16, 2024 · 5 comments
Closed

Add support for arbitrary input for prompts #422

danmatichuk opened this issue Jul 16, 2024 · 5 comments
Assignees

Comments

@danmatichuk
Copy link
Collaborator

Currently the only input that the verifier supports is choosing from a list of options. This has a number of drawbacks that are already apparent (i.e. when selecting addresses for sync/desync points), and would make it difficult to provide the necessary input for providing additional constraints to counter-examples.

As an interim solution pending a better protocol between the front and backend, we can simply add a command to the TTY that takes a string as input and is parsed in the context of the current prompt. The most straightforward solution is to have these always parsed as JSON objects into some simple AST datatype that is then interpreted by the prompt.

@danmatichuk danmatichuk self-assigned this Jul 16, 2024
@thebendavis thebendavis added this to the Improved path directives milestone Jul 16, 2024
@jim-carciofini
Copy link
Contributor

This sounds like a good interim solution.

@danmatichuk
Copy link
Collaborator Author

WIP: #423

@lcasburn
Copy link
Collaborator

lcasburn commented Jul 17, 2024

From @danmatichuk:

  • Done: Initial implementation of core functions for trace tree datatype holding structured logging & menu options
  • Next steps
    • Test API is sensible by adapting one of the existing menus to accept text input that exercises end-to-end capability. For example, change menu where you define an address for sync/desync point so that users can manually type addresses.
    • Update script interface to support this feature, allowing regression suite updates

@lcasburn
Copy link
Collaborator

From @danmatichuk

  • Done: Implemented menu for selecting the sync/desync to accept address string
  • Today: Add command in repl to use the new input mechanism
  • Next: Update script interface to support this feature, allowing regression suite updates

@danmatichuk
Copy link
Collaborator Author

I've now updated the scripting backend to be agnostic of whether or not a given input element is a menu selection or parsed input. e.g. a script step > foo will both provide "foo" as input or select a choice matching the text "foo" from a list of options, which is just determined contextually. At the cost of some ambiguity, this makes it easier to update the existing menus without needing to do any updates to the test scripts.

This is mostly working, except for some strange differences in behavior when running the verifier through pate.sh vs. cabal test. My current hypothesis is that this is some kind of race condition/data contention issue, since the input is provided asynchronously to the verifier.

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

No branches or pull requests

4 participants