Repository navigation
Releases: i2y/rulec
Release list
rulec v0.22.1
Nothing that passed in 0.22.0 fails in 0.22.1, and no answer changes. What moves is the buf module gen writes beside the Connect service.
Fixed
- A contract that imports a file from a BSR module now builds. A rule whose
.protocontract imports protovalidate'sbuf/validate/validate.proto, say, got a module thatbuf generatecould not build, andrulec testfailed its Connect passes at that import.gennow declares, inproto/buf.yaml, the module the import comes from, and writesproto/buf.lockwith the pins of thebuf.lockbeside the contract — both read from the contract's own buf workspace. It fetches nothing itself: buf fetches the module when it builds.
Added
rulec api'sconnectentry names those modules underdeps, so that a caller who builds the stubs with a template of its own knows the module has dependencies.
Changed
proto/buf.gen.yamlwrites the stubs of the files a contract imports from a BSR module too (include_imports: trueon the py plugin), since the contract's stub imports them. Every generated tree'sbuf.gen.yamlchanges with this, sorulec gen --checkreports it until it is generated again.- When nothing beside the contract can pin the module — no
buf.yamlabove it, or abuf.lockstill in v1's shape, whose shake256 digests a v2 module does not read —gendeclares the module, writes nobuf.lock, and says to runbuf dep updateinproto/. Twobuf.lockfiles that pin one module at two commits stopgen. - For a rule with such a contract, the Connect passes of
rulec testreach the network when buf does not have the module cached yet.
One static binary per platform, no runtime; on Linux also as a .deb and an .rpm. Verify a download against SHA256SUMS before running it; the install page says how.
rulec v0.22.0
Rules that passed and now fail
| Code | What it stops |
|---|---|
| E002 | An alias in parentheses that is not a name. 六十(60) passed with the parentheses dropped, so the value had no alias at all. |
| E032 | A rule that imports an enum from a .proto whose name has a run of capitals (HTTPMethod) or whose values leave a digit after the prefix (SIZE_60), with the aliases the old reading asked for — the zero value http_method_unspecified among them. The prefix is now split the way buf splits it (HTTP_METHOD_), and SIZE_60 is size_60. A contract that passes buf lint no longer fails E032 for its names. |
Fixed
- The Connect service of a rule with an enum imported from a
.protodid not start as generated: it imported the contract's stubs as a top-level module, found only withstubs/added toPYTHONPATH. It imports them fromstubs/now. rulec testfailed the Connect passes of such a rule, andbuf generatein the generatedproto/stopped at the import: the contract was not in the module. See Changed.rulec apiandrulec doc --format htmllooked for the files a rule cites from the working directory instead of the rule's own.apinamed an imported enum without its package, and the approver's page read inputs out of a.protocontract in a way protojson does not write them.- A rule's own enum whose alias has a run of capitals (
HTTPRoute) was written to the.protoasH_T_T_P_ROUTE_…, whichbuf lintrefuses and on which the service failed to start. It isHTTP_ROUTE_…. - The service's description said
--httpneeds nothing installed. The server is the standard library's;connectrpcand the stubs are still needed.
Added
rulec api'sconnectentry describes the wire for a caller that writes the JSON by hand:enums, with each value's name on the wire and its number, the name of value 0 when it means "not set", and the contract an imported enum comes from;optionalandenumon every field; andelement_fieldsfor a rule that walks a sequence.
Changed
- The generated Connect service refuses a request that leaves an input out (
invalid_argument,会員: not set). Every field of the request is nowoptionalin the.proto. proto3 read a field left out as its zero, so a request that named nothing was decided as 0,falseand the first value — and, where a contract puts a real value at 0, as that value. A caller that leavesfalseor0out of its JSON is now refused, andbuf breakingreports the change. - It refuses a field or an enum value the request message does not have (
invalid_argument). Connect's JSON reader drops them by default, so a misspelt input was decided as zero. gencopies the contract animport protoenum comes from into the generated module, byte for byte, at the path its package gives it (proto/shop/v1/order.proto), and the generated.protoimports it from there. A file the contract imports comes with it when it is found beside it; one from a BSR module, such as protovalidate's, does not, and buf names it. Two different contracts that would land on one path stopgen.
One static binary per platform, no runtime; on Linux also as a .deb and an .rpm. Verify a download against SHA256SUMS before running it; the install page says how.
rulec v0.21.2
Nothing that passed in 0.21.1 fails in 0.21.2, and no answer changes. Only the Japanese wording moves.
Changed
- The Japanese output uses the words the Japanese pages use. Under
--lang ja, the diagnostics,rulec explain, the CLI help and the comments in generated code now say ツール for 道具, リクエスト for 要求 where it means a request, ジェネレーター for 生成器, ネスト for 入れ子, ローカル for 手元, and レスポンス for an HTTP answer. A diagnostic quoted on a page and the sentence under it no longer name one thing two ways. The English output is unchanged, and so are the codes and every JSON key.
One static binary per platform, no runtime; on Linux also as a .deb and an .rpm. Verify a download against SHA256SUMS before running it; the install page says how.
rulec v0.21.1
Nothing that passed in 0.21.0 fails in 0.21.1, and no answer changes. This release is about how rulec gets onto a machine.
Added
-
Homebrew, on macOS and on Linux:
brew install i2y/tap/rulec. The formula installs this release's archive for the platform, pinned to its SHA-256. Each release rewrites it, and only after brew has audited, installed and tested it on macOS and on Linux. -
.deband.rpmfor x64 and arm64, beside the archives and in the sameSHA256SUMS. They hold the same static binary and depend on nothing: before it was published, each one was installed on Debian or Fedora with the network off, checked the corpus clean, and was removed again.$ sudo apt install ./rulec_0.21.1-1_amd64.deb $ sudo dnf install ./rulec-0.21.1-1.x86_64.rpm
There is no package repository behind them, so
apt upgradeanddnf upgradedo not see the next release. The install page (日本語) has the lines that check a download againstSHA256SUMSfirst.
Changed
- Compatibility now names the packages beside the archives,
i2y/tap/rulec, the.deband the.rpm, among the names every 1.x release keeps.
One static binary per platform, no runtime; on Linux also as a .deb and an .rpm. Verify a download against SHA256SUMS before running it; the install page says how.
rulec v0.21.0
Rules that passed and now fail
Each of these was read as something other than what was written, or passed the check and then failed in the generated code. A rule that now fails with one of them was being misread.
| Code | What it stops |
|---|---|
| E058 | A declaration line that cannot be read: a define, derive, result, enum, group or table with no name, or with something before its =. A table with no name was read as an anonymous one, and its generated code lost the scale of its output — an answer a thousand times too large. A rule line with no name passed as a rule with nothing in it. |
| E059 | An expression that cannot be read to its end. amount tax (an operator left out) and amount -100円 (a sign touching the digits) were both read as amount. |
| E060 | A step or a rounding grid of zero or less. round up(0円) divided by zero in the generated code, and rate[step 0%] was read as a step of one. A rounding call whose grid is a name is now E118. |
| E061 | A range with no value in it (range >=10円 <=0円). |
| E062 | A date that does not exist (2026-01-99). |
| E063 | A cell that cannot be read. Words after a comparison (<=0円 + false) or after a value (a b) were dropped, and a cell that could not be read at all moved every cell after it one column to the left. |
| E064 | A row that does not fit its header. A row whose closing | was left off lost its last cell, and a row one cell short was read as it stood. |
| E019 | Now also an example whose value lies outside the declared range, an input the generated code refuses at its door. |
Fixed
- A malformed
deriveline no longer makesrulec checkrun for ever (in the playground, typing one froze the page), and÷ 0and awherewith nothing to compare no longer panic. - A one-letter flag is refused before anything is done.
rulec gen x.rule -o outused to write intogenerated/first, andrulec fmt x.rule -crewrote the file it was asked to look at.-his--help, and a misspelled flag is answered with the one it was most likely meant to be. - JSON nested deeper than 256 levels is refused instead of running the process out of stack.
Added
rulec mcp --timeout <seconds>, 600 by default. A tool call that runs past it is stopped together with what it started, answered as failed, and the server goes on to the next call. Any exit other than 0 and 1 is now reported as an error.- The certificate carries
"v":1. Both re-checkers —tools/recheck.pyand the Lean program inproofs/— refuse a version they were not written for. - Compatibility (日本語): what every 1.x release will keep, and what it may still change.
Changed
- E115 is titled "The divisor is not a positive constant". Zero, negative numbers and fractions were already refused under it, as "Cannot divide by a variable".
- The ledger has 109 diagnostic codes, up from 102.
One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.
rulec v0.20.0
One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.
rulec v0.19.1
One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.
rulec v0.19.0
One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.
rulec v0.18.0
One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.
rulec v0.17.0
One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.