{"id":20754310,"url":"https://github.com/mrigankpawagi/guardrails","last_synced_at":"2025-04-28T16:28:24.995Z","repository":{"id":187845259,"uuid":"663464273","full_name":"mrigankpawagi/GuardRails","owner":"mrigankpawagi","description":"VSCode extension to help developers set up guardrails around their functions, by helping them disambiguate purpose statements.","archived":false,"fork":false,"pushed_at":"2025-01-11T17:49:19.000Z","size":11741,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T01:14:00.323Z","etag":null,"topics":["llms","python","specifications","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=MrigankPawagi.guardrails","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrigankpawagi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-07T10:56:03.000Z","updated_at":"2025-01-11T14:24:34.000Z","dependencies_parsed_at":"2025-04-12T15:01:13.834Z","dependency_job_id":null,"html_url":"https://github.com/mrigankpawagi/GuardRails","commit_stats":null,"previous_names":["mrigankpawagi/guardrails"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FGuardRails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FGuardRails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FGuardRails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FGuardRails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrigankpawagi","download_url":"https://codeload.github.com/mrigankpawagi/GuardRails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251345136,"owners_count":21574652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llms","python","specifications","vscode-extension"],"created_at":"2024-11-17T09:17:04.823Z","updated_at":"2025-04-28T16:28:24.990Z","avatar_url":"https://github.com/mrigankpawagi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GuardRails: Automated Suggestions for Clarifying Ambiguous Purpose Statements\n\nVSCode extension to help developers write complete and unambiguous docstrings for their Python functions. Install it now from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=MrigankPawagi.guardrails).\n\n\u003e [!IMPORTANT]\n\u003e Our paper was presented at the 6th Annual COMPUTE Conference by ACM India. Check it out [here](https://dl.acm.org/doi/10.1145/3627217.3627234) (or [here](https://arxiv.org/abs/2312.08189) on arXiv).\n\n![Demo](https://raw.githubusercontent.com/mrigankpawagi/GuardRails/master/media/graphics/demo.gif)\n\n\u003e [!WARNING]  \n\u003e Due to recent updates in the Copilot's VSCode extension, functionality critical for GuardRails is no longer supported. Please hang on while we update GuardRails. If you are interested in contributing, check out [this](https://github.com/mrigankpawagi/GuardRails/pull/6).\n\n## Requirements\n\nYou need Python 3 installed on your system to use GuardRails. \n\n__Note:__\nGuardRails is fully tested only on Windows and currently provides experimental support for Linux.\n\n### Installing Python Dependencies\n\n```bash\n$ python -m pip install hypothesis hypothesis[cli] hypothesis[ghostwriter] black\n$ python -m pip install git+https://github.com/mrigankpawagi/mutpy.git#egg=mutpy\n$ python -m pip install func-timeout\n```\n\n## A Motivating Example\n\n```python\ndef first_nonzero(nums: list[float]) -\u003e float:\n    \"\"\" Return the first non-zero value in nums.\n    \n    \u003e\u003e\u003e first_nonzero([0.0 , 3.7 , 0.0])\n    3.7\n    \"\"\"\n```\n\nThis is an example of an incomplete function definition in Python. It has a purpose statement (called the _docstring_) which contains a functional example (called a _doctest_). The purpose statement is ambiguous because it does not specify the intended behavior on lists with no non-zero elements.\n\n## Contributions\n\n### Heuristic\nWe propose a novel heuristic that suggests such inputs using Large Language Models (LLMs). Using these suggestions, the programmer may choose to clarify the purpose statement (e.g., by providing a _functional example_ that specifies the intended behavior on such an input). Check out our paper for more details on our heuristic.\n\n![image](https://github.com/mrigankpawagi/GuardRails/assets/25179158/a298112a-7030-459a-8e72-129e779995b3)\n\n### Open Dataset\nTo assess the quality of inputs suggested by our heuristic, and to facilitate future research, we create an open dataset of purpose statements with known ambiguities. For each function, we provide four variants of prompts.\n\n- **S** (Signature)\n - **SP** (**S** + Purpose statement)\n- **SP1** (**SP** + 1 functional example)\n- **SPx** (**SP** + More functional examples)\n\nOur dataset is publicly available [here](https://docs.google.com/spreadsheets/d/e/2PACX-1vRwmXlP8V6gbXtB1oQ5IUXfbRjW3eoCYKcbm-zN4uXphd_AK4Wj0CZzVmeXW4XvF2_scszdCD89CFpV/pubhtml?gid=0\u0026single=true). We use this dataset to compare GuardRails with test cases generated by GitHub Copilot Chat. More details on this are available in our paper.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrigankpawagi%2Fguardrails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrigankpawagi%2Fguardrails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrigankpawagi%2Fguardrails/lists"}