-
Notifications
You must be signed in to change notification settings - Fork 20
Witness yaml #192
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
Witness yaml #192
Conversation
- Add from_file_with_types() with JSON→YAML format detection - Support witness: and arguments: sections in YAML - Allow comments and documentation in witness files - Maintain 100% backward compatibility with existing JSON files - Add 8 YAML format validation tests - Deprecate from_json_with_types() (still functional) - Update CLI to indicate YAML/JSON format support All 15 old JSON tests pass. New implementation tested with 8 unit tests.
Updated comments to clarify witness file parsing process.
… into witness-yaml
|
Thank you for your PR. There seems to be a conflict with the recently merged #187. CI seems to be blocked on a rebase. |
|
Regarding the timeline with #187: #186 was opened Dec 24, I started #192 based on a pre-#187 fork (merged Dec 27), and opened #192 Dec 29. #192 fully implements #186 (optional param/witness modules) - the code change from #187 was parallel work on #186. The team can choose which approach to use. Happy to address any technical questions. |
I complained about your LLM-generated diff and proposed a new one, which I implemented in #187, which is simpler and more complete. It is already merged (and was merged a week before your most recent comment saying the team can "choose which approach to take").
We are not going to implement a YAML witness parser. I provided some reasoning in this comment. I'm going to close this because I think both changes in this PR are going nowhere. |

Add YAML support for witness and arguments files
This PR solves issue #177 - "Witness files should not require explicit type annotations"
This PR is a refactoring on PR #190 - #190 can be skipped.
Summary
Add optional YAML format support for witness and arguments files with intelligent format detection. JSON remains the standard format; YAML is supported as an alternative when users prefer comments and documentation.
Changes
Core Implementation
src/serde.rs: Add YAML parsing functionsfrom_file_with_types(): Intelligent format detection (JSON first, YAML fallback)from_yaml_with_types(): Explicit YAML parser withwitness:andarguments:sectionsFormat Support
JSON (Standard)
{ "x": { "value": "0x0001", "type": "u32" }, "y": { "value": "1000", "type": "u32" } }Note: The
"type"field is optional and ignored - types are inferred from compiler context.JSON (Sloppy format accepted)
{ "x": "0x0001", "y": "1000" }YAML (Optional)
Features
Testing
src/serde.rsCI Testing
Dependencies
serde_yaml = "0.8"toCargo.toml(compatible with rustc 1.79.0+)Breaking Changes
None. All existing code continues to work without modification.
Migration Guide
No migration required. Existing JSON files work as before. YAML support is optional.