Skip to content

Releases: i2y/rulec

rulec v0.22.1

Choose a tag to compare

@github-actions github-actions released this 01 Oct 14:12

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 .proto contract imports protovalidate's buf/validate/validate.proto, say, got a module that buf generate could not build, and rulec test failed its Connect passes at that import. gen now declares, in proto/buf.yaml, the module the import comes from, and writes proto/buf.lock with the pins of the buf.lock beside 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's connect entry names those modules under deps, so that a caller who builds the stubs with a template of its own knows the module has dependencies.

Changed

  • proto/buf.gen.yaml writes the stubs of the files a contract imports from a BSR module too (include_imports: true on the py plugin), since the contract's stub imports them. Every generated tree's buf.gen.yaml changes with this, so rulec gen --check reports it until it is generated again.
  • When nothing beside the contract can pin the module — no buf.yaml above it, or a buf.lock still in v1's shape, whose shake256 digests a v2 module does not read — gen declares the module, writes no buf.lock, and says to run buf dep update in proto/. Two buf.lock files that pin one module at two commits stop gen.
  • For a rule with such a contract, the Connect passes of rulec test reach 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

Choose a tag to compare

@github-actions github-actions released this 01 Oct 12:30

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 .proto did not start as generated: it imported the contract's stubs as a top-level module, found only with stubs/ added to PYTHONPATH. It imports them from stubs/ now.
  • rulec test failed the Connect passes of such a rule, and buf generate in the generated proto/ stopped at the import: the contract was not in the module. See Changed.
  • rulec api and rulec doc --format html looked for the files a rule cites from the working directory instead of the rule's own. api named an imported enum without its package, and the approver's page read inputs out of a .proto contract 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 .proto as H_T_T_P_ROUTE_…, which buf lint refuses and on which the service failed to start. It is HTTP_ROUTE_….
  • The service's description said --http needs nothing installed. The server is the standard library's; connectrpc and the stubs are still needed.

Added

  • rulec api's connect entry 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; optional and enum on every field; and element_fields for 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 now optional in the .proto. proto3 read a field left out as its zero, so a request that named nothing was decided as 0, false and the first value — and, where a contract puts a real value at 0, as that value. A caller that leaves false or 0 out of its JSON is now refused, and buf breaking reports 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.
  • gen copies the contract an import proto enum comes from into the generated module, byte for byte, at the path its package gives it (proto/shop/v1/order.proto), and the generated .proto imports 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 stop gen.

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

Choose a tag to compare

@github-actions github-actions released this 28 Sep 13:41

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

Choose a tag to compare

@github-actions github-actions released this 27 Sep 07:04

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.

  • .deb and .rpm for x64 and arm64, beside the archives and in the same SHA256SUMS. 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 upgrade and dnf upgrade do not see the next release. The install page (日本語) has the lines that check a download against SHA256SUMS first.

Changed

  • Compatibility now names the packages beside the archives, i2y/tap/rulec, the .deb and 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

Choose a tag to compare

@github-actions github-actions released this 26 Sep 05:28

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 derive line no longer makes rulec check run for ever (in the playground, typing one froze the page), and ÷ 0 and a where with nothing to compare no longer panic.
  • A one-letter flag is refused before anything is done. rulec gen x.rule -o out used to write into generated/ first, and rulec fmt x.rule -c rewrote the file it was asked to look at. -h is --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.py and the Lean program in proofs/ — 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

Choose a tag to compare

@github-actions github-actions released this 25 Sep 11:36

One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.

rulec v0.19.1

Choose a tag to compare

@github-actions github-actions released this 23 Sep 13:59

One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.

rulec v0.19.0

Choose a tag to compare

@github-actions github-actions released this 23 Sep 13:02

One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.

rulec v0.18.0

Choose a tag to compare

@github-actions github-actions released this 23 Sep 04:15

One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.

rulec v0.17.0

Choose a tag to compare

@github-actions github-actions released this 22 Sep 22:49

One static binary per platform, no runtime. Verify an archive against SHA256SUMS before running it; the install page says how.