dry-validation-rust 0.1.0.pre5 → 0.1.0.pre6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +13 -0
  3. data/.markdownlint.yml +9 -0
  4. data/.rubocop.yml +124 -0
  5. data/.ruby-version +1 -0
  6. data/.tool-versions +1 -0
  7. data/.yardopts +4 -0
  8. data/AGENTS.md +376 -0
  9. data/CHANGELOG.md +71 -0
  10. data/CODE_OF_CONDUCT.md +42 -0
  11. data/CONTRIBUTING.md +159 -0
  12. data/Cargo.lock +809 -0
  13. data/Cargo.toml +10 -0
  14. data/GOVERNANCE.md +68 -0
  15. data/Gemfile +15 -0
  16. data/Gemfile.lock +132 -0
  17. data/NOTICE.md +5 -5
  18. data/README.md +206 -181
  19. data/Rakefile +350 -0
  20. data/SECURITY.md +98 -0
  21. data/SECURITY_AUDIT.md +33 -0
  22. data/SUMMARY.md +30 -0
  23. data/SUPPORT.md +67 -0
  24. data/book.toml +9 -0
  25. data/codecov.yml +11 -0
  26. data/compatibility.yml +453 -0
  27. data/deny.toml +7 -0
  28. data/dry-validation-rust.gemspec +21 -23
  29. data/ext/dry_validation_rust/Cargo.toml +7 -7
  30. data/ext/dry_validation_rust/build.rs +5 -0
  31. data/ext/dry_validation_rust/extconf.rb +12 -0
  32. data/ext/dry_validation_rust/fuzz/.gitignore +5 -0
  33. data/ext/dry_validation_rust/fuzz/Cargo.toml +19 -0
  34. data/ext/dry_validation_rust/fuzz/corpus/parse_plan/basic_params.json +1 -0
  35. data/ext/dry_validation_rust/fuzz/fuzz_targets/parse_plan.rs +9 -0
  36. data/lib/dry/validation/rust/path_trie.rb +15 -8
  37. data/lib/dry/validation/rust/schema/dsl.rb +8 -0
  38. data/lib/dry/validation/rust/schema/field_definition.rb +3 -1
  39. data/lib/dry/validation/rust/schema/predicate_block.rb +2 -1
  40. data/lib/dry/validation/rust/schema/ruby_type_processor.rb +38 -23
  41. data/lib/dry/validation/rust/version.rb +1 -1
  42. data/supply-chain/audits.toml +4 -0
  43. data/supply-chain/config.toml +368 -0
  44. data/supply-chain/imports.lock +4 -0
  45. data/support_matrix.yml +9 -0
  46. metadata +64 -25
  47. data/docs/ARCHITECTURE.md +0 -256
  48. data/docs/COMPATIBILITY.md +0 -198
  49. data/docs/FEASIBILITY.md +0 -207
  50. data/docs/SUPPORT_MATRIX.md +0 -66
  51. data/docs/VERIFICATION.md +0 -128
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,159 @@
1
+ # Contributing to dry-validation-rust
2
+
3
+ Thank you for helping improve `dry-validation-rust`. This is a hybrid
4
+ Ruby/Rust native extension, so changes must preserve both Ruby-facing behavior
5
+ and the safety of the Rust FFI boundary.
6
+
7
+ Before starting substantial work, open an issue or comment on an existing one
8
+ so scope and compatibility expectations can be agreed. Keep pull requests
9
+ focused on one behavior, maintenance concern, or documentation change.
10
+ Roadmap priorities, milestone scope, label meanings, and project-board flow are
11
+ defined in [docs/PROJECT_MANAGEMENT.md](docs/PROJECT_MANAGEMENT.md).
12
+
13
+ ## Prerequisites
14
+
15
+ Use a Ruby, Rust toolchain, and platform listed in
16
+ [the support matrix](docs/SUPPORT_MATRIX.md). A source checkout currently
17
+ requires:
18
+
19
+ - CRuby 3.3 or newer with development headers;
20
+ - Rust 1.75 or newer and Cargo (the MSRV, tested in CI);
21
+ - Bundler;
22
+ - a C compiler and `make`;
23
+ - Clang/libclang when the selected `rb-sys` build requires bindgen.
24
+
25
+ The checkout pins Rust 1.75.0 in `rust-toolchain.toml`, so the documented
26
+ commands use the MSRV by default. Do not introduce code or dependencies that
27
+ require a newer Rust release unless the MSRV policy is intentionally updated.
28
+
29
+ On macOS, install the Xcode Command Line Tools and LLVM. On Debian/Ubuntu,
30
+ install a build toolchain plus `clang` and `libclang-dev`.
31
+
32
+ ## Clean-checkout setup
33
+
34
+ ```bash
35
+ git clone https://github.com/alex-tomilov/dry-validation-rust.git
36
+ cd dry-validation-rust
37
+ bundle install
38
+ bundle exec rake compile
39
+ script/verify
40
+ ```
41
+
42
+ `script/verify` is the canonical local gate. It compiles the native extension,
43
+ runs the Ruby and Rust tests, checks Rust formatting and Clippy warnings,
44
+ verifies the lockfile, builds the source gem, installs it into an isolated gem
45
+ home, and runs an installed-package smoke contract.
46
+
47
+ ## Test layers
48
+
49
+ Use the smallest relevant check while developing, then run `script/verify`
50
+ before requesting review.
51
+
52
+ ```bash
53
+ # Ruby integration suite
54
+ script/test
55
+
56
+ # One Ruby test file
57
+ bundle exec ruby -Itest test/schema_test.rb
58
+
59
+ # Rust unit tests and quality checks
60
+ cargo test --locked --manifest-path ext/dry_validation_rust/Cargo.toml
61
+ cargo fmt --check --manifest-path ext/dry_validation_rust/Cargo.toml
62
+ cargo clippy --manifest-path ext/dry_validation_rust/Cargo.toml \
63
+ --all-targets --all-features -- -D warnings
64
+
65
+ # Source-gem contents and clean-install smoke
66
+ bundle exec rake package:audit
67
+ ```
68
+
69
+ Rust code must be formatted with `rustfmt` and pass Clippy with warnings denied.
70
+ Consider installing a pre-commit hook so formatting issues are caught before
71
+ pushing:
72
+
73
+ ```bash
74
+ cargo install cargo-husky
75
+ ```
76
+
77
+ Code must compile on the Rust 1.75 MSRV; all CI workflows use and test that
78
+ exact toolchain.
79
+ Runtime and FFI code must not use `unwrap`, `expect`, broad `.ok()`, or
80
+ `unwrap_or(default)` unless the reason is narrow, documented, and reviewed.
81
+ No Rust panic may cross the Ruby FFI boundary.
82
+
83
+ ## Compatibility fixtures
84
+
85
+ The current baseline fixtures live in `test/fixtures/baseline` and are
86
+ exercised by `test/baseline_fixture_test.rb`.
87
+
88
+ When changing compatibility behavior:
89
+
90
+ 1. Add or update a narrowly named scenario in
91
+ `test/baseline_fixture_test.rb`.
92
+ 2. Add the expected normalized result under
93
+ `test/fixtures/baseline/<scenario>.json`.
94
+ 3. Cover valid and invalid input when both paths are relevant.
95
+ 4. Compare the same contract and input against the pinned
96
+ `dry-validation` and `dry-schema` versions from
97
+ `docs/SUPPORT_MATRIX.md`, in a separate process.
98
+ 5. Include both outputs, exceptions, and version details in the pull request.
99
+
100
+ The full differential harness is not implemented yet. Until it is, do not
101
+ describe a local baseline fixture as proof of upstream parity.
102
+
103
+ ## Changelog policy
104
+
105
+ Add an entry under `Unreleased` in `CHANGELOG.md` for user-visible behavior,
106
+ compatibility changes, packaging changes, security changes, or meaningful
107
+ documentation changes. Internal refactors that do not affect users generally
108
+ do not need an entry.
109
+
110
+ Do not rewrite released changelog sections except to correct a factual error.
111
+
112
+ ## Benchmark evidence
113
+
114
+ Performance claims require reproducible before/after evidence. Include:
115
+
116
+ - the exact benchmark script and revision;
117
+ - warmup and measured iteration counts;
118
+ - Ruby, Rust, dependency, OS, CPU, and memory details;
119
+ - throughput or latency plus RSS/allocations where relevant;
120
+ - raw results from multiple runs;
121
+ - compatibility checks proving semantics did not change.
122
+
123
+ `script/benchmark-smoke` is a non-gating sanity check, not evidence for a
124
+ public performance claim.
125
+
126
+ ## Pull requests
127
+
128
+ The repository currently uses `develop` as the active integration branch and
129
+ `main` as the default/release branch. Unless a maintainer requests otherwise,
130
+ open feature and maintenance pull requests against `develop`. Tested changes
131
+ are promoted to `main`; releases are tagged from `main`.
132
+
133
+ Pull requests should:
134
+
135
+ - link the implementation issue and milestone;
136
+ - explain the problem and the chosen design;
137
+ - identify public API and compatibility impact;
138
+ - include regression tests for behavior changes;
139
+ - remain small enough to review as one coherent change;
140
+ - update relevant documentation and the changelog;
141
+ - report exact verification commands and results;
142
+ - avoid drive-by formatting or unrelated refactoring.
143
+
144
+ Prefer squash merging for a focused pull request. Do not force-push after
145
+ review has started unless necessary to remove sensitive data or repair the
146
+ branch, and explain any rewritten history.
147
+
148
+ Do not commit generated native libraries, packaged `.gem` files, Cargo
149
+ `target` output, generated Makefiles, or other build artifacts. Release tooling
150
+ may generate binary artifacts in CI, but those artifacts belong in the release
151
+ pipeline rather than the source tree.
152
+
153
+ ## Contribution certification
154
+
155
+ The project does not require a Contributor License Agreement or mandatory
156
+ Developer Certificate of Origin sign-off at this stage. By contributing, you
157
+ confirm that you have the right to submit the work under the repository's MIT
158
+ license. A future certification change will be proposed publicly before it is
159
+ enforced.