Repository navigation
ritsu v0.40.0
ritsu 0.40.0
Added
- sakai's E208 holds a rule's
implementsas it holds a workflow's: the service a rule implements must be underopen host serviceof a published language of the rule's own context. Rules that implement the services of one contract are published as the contract:published language <the contract's package>withproto "<contract>", and the services the rules implement underopen host service; the rules need only be owned. Where rules published one by one meet in one block (E004) or in one package (E006), the notes show this form. A context that publishes one such rule as a block of its own (rulec "<rule>", in the contract's package) still passes, with the service under that block'sopen host service. use rule … connectto a rule that implements a contract's service lands on the published language that lists the contract, and passes when the service is an open host service there. It was E202.sakai doclists rules among what implements an open host service, with the service each one implements.rulec gennames the.protoan earliergenwrote for a rule before the rule implemented a contract's service, when it is still in the output directory at another path than the contract's copy, and says it can be deleted. It deletes nothing, and the exit code is what it was.--checknames it too, and--format jsonlists it under a new key,left. Only a file whose first line is rulec's head (// Code generated by rulec …) is named.ritsu check --format jsongives what each file's own language says of it: each item offilesends withcheck, what the language'scheck --format jsonwrites of that file, without itsfile,rootanddiagnostics, in the language's own shape. A kaname module's has itssummaryand theeffectof each function; a book's, itsreport; a spec's, itsclaims; a date file's, a gate's, a map's and a module's requirements' (the same on each of its.reqfiles), theirokandsummary. A rule's, a.proto's and that of a context that is no map arenull, and a flow's is{}.ritsu check --format jsonlists each border it checked:borderskeepsheld,failedandundecided, and addsrecords, one for each border, as many as the three add up to. A record says which check it is (precondition,rule_date_input,range_from_koyomi,transfer_amount,transfer_refusals,hold_expiry,koyomi_date_input,secret_destination,operation_guardorworkflow_permission), what it isabout, its two sidesatandto, each with itstool,fileandline(and itsdependencyin a module), itsresult, and thecodeof the diagnostic ritsu gave (nullwhen it holds). The records come in the order of those words, then by the file and the line ofat. A check keeps its word, and a new one is added at the end.- dandori's
dateandtimestamptake arangewhere a number does: in the workflow's inputs and outputs, a record's fields, and a task's arguments and results. The ends are days,>=2026-01-01 <=2027-12-31, or one of them alone; a time's ends are days in UTC, or at the offset written after them (offset +09:00). A value is checked where it comes in, as a number is: an input outside its range fails the run withDandori.BadInput, a result outside it withDandori.BadResponse. Every platform compares the text: a date's ten characters with the range's first and last days, and a time's first nineteen characters (to the second) with the range's first second and the first second after the range, so23:59:59.5Zis inside the second it is in. now range >=2026-01-01 <=2027-12-31underworkflowsays the period the workflow runs in (anoffsetcan follow). A run that starts outside it calls nothing and fails withDandori.OutOfPeriod, as a run with a bad input does, andon failuredoes not run. Each statement that readsnowchecks the clock first and reads that moment; outside the period, the run goes toon failureas it does for a task's error that nothing handles (it is not retried, and a task'sondoes not take it), and fails where there is noon failure.nowinon failureandon cancelis not held to the period, so that the cleanup runs whatever the clock says.- dandori's checks hold dates, times and
nowto their ranges. The check of ranges (E014, W104) holds them to the ranges they are given to; in a workflow that says its period,nowis a moment of that period, and the day of a koyomi date is the days koyomi counts for it. E015 holds a child flow's ranges of dates and times to the ranges the task gives its arguments. The check of a case left open (W101, E020) counts the check before a statement that readsnowas a place the run can go toon failurefrom. dandori scenariostries the ranges and the period: each input held to a range of dates or times just outside the range and at its ends (a time's last second with.5after it), a run that starts just outside the period, and a run whose clock leaves the period after it starts. A scenario'snowcan be two moments,[start, later]; the runners of the seven platforms andritsu runread both.dandori docsays the period at the head of the picture,Dandori.OutOfPeriodamong the ends, and which lines'nowcan send the run toon failure.ritsu checkdecides the day a workflow gives over the range it comes from: the day given to a koyomi date's input (E205, W205), to a rule's date input (E202, W202), or to a rule input whose range isrange from koyomi(E201, W201), when it comes from a date with a range, a time with a range, ornowin the period. A time andnoware read as days at the offset of the dates file's calendar, and a range with an open end can be outside. A relation between two dates with ranges (check_in <= check_out) is decided as one between numbers is.- The records of those three checks in
ritsu check --format json(koyomi_date_input,rule_date_input, andpreconditionforrange from koyomi) have five more keys aftercode:given,takes,from(every place the day can come from, by itskind:day,range,moment,now,unknownoroutput),exampleandwhy. - dandori's invoice example says the period it runs in, and
ritsu checkon it is all pass with 6 warnings, 8 borders checked and 6 undecided: the two W205 on itsnoware gone.
Fixed
- One statement reads one moment, however many times it says
now, on every platform. Temporal (TypeScript, Python and Go) read the clock in the code each try of a call runs, so a call that was retried passed a laternowon each try; the clock is read once, before the call. pydantic-graph read the clock for eachnowin a node; it is read once, at the head of the node. Argo evaluatednow()in each expression; a template that reads the clock comes before each statement that readsnow, andwait untilandtimeout untilwork their seconds out from one reading. - The reference interpreter, run as Argo, gives a child workflow template's failure an empty cause, as Argo does.
dandori docsaysDandori.BadInputandDandori.BadResponseare an input and a result that do not fit the declared type or range.
Changed
- The rulec skill's
SKILL.mdkeeps the steps of every change, and the steps for one occasion (in CI,rulec verify,rulec diff,rulec doc) move tomore-of-the-loop.md, whichSKILL.mdpoints to.ritsu skills installwrites the new file with the others. - kaname names the checks across the languages by the words
ritsu checkgives them:precondition,rule_date_input,transfer_amountandkoyomi_date_input, inplaces[].checkofkaname check --format json, inchecks[].checkofkaname api, and in the sentences of a page ofkaname docfor a place that waits for ritsu's answer (transfer_refusalsfor the reasons a transfer can be refused with). They were the marks of ritsu's design,X2,X3,X4andX6. - The Japanese of
rulec gen's stop where a contract's copy would land on the.protogenerated from a rule, and of the fixes of E076 and E310, calls the filegencopies a copy (コピー), as the rest of ritsu does; it used the word 写す.
On the site
- The top page's part on where the languages meet shows the JSON of a border's record, run from a reproduction, and the words of the ten checks.
- rulec's Generate says that
gennames the.protoa rule left behind when it took a contract. - dandori's Write a workflow and Dates and books show the ranges of dates and times and the period a workflow runs in, What it checks how they are checked, and Build for a platform how each platform reads the clock.
- The top page's list of the checks across the languages has the day a workflow gives a koyomi date from a range of dates or times, or from the period.
The Japanese pages say the same.
A home page in Simplified Chinese, at /zh/, introduces ritsu on one page and leaves the rest to the English pages. The repository has the same introduction as README.zh.md, and the READMEs and the site's language switch link to it.
Changes that can make a run that used to pass fail
sakai checkgives E208 for a rule that implements a service its context does not publish: the contract's.protois in no published language of the context, or the service is not under that block'sopen host service. A rule published asrulec "<rule>"with noopen host servicegives E208 too; before, only a workflow that called it failed (E207).rulec gen --format jsonhas one more key,left, always present. A reader that refuses keys it does not know sees a new one.ritsu check --format jsonhas two more keys, always present:checkon each item offiles, andrecordsinborders. A reader that refuses keys it does not know sees new ones.kaname check --format jsonandkaname apiwritecheckwith a word in place ofX2,X3,X4orX6(above). A reader that matched the marks sees the words.- The Japanese texts of E076 and E310 that
ritsu explaingives, and ofrulec gen's stop above, are rewritten; a run that compares them with saved copies sees the difference. - A flow that writes a range on a date or a time, or
now range, is E001 for dandori 0.39.0. - The generated code of a flow that reads
nowchanges, whether it says a period or not. Temporal (TypeScript, Python and Go) reads the clock before a call that readsnow(const dd_now_<site> = dd.now();and the like). The clock is the workflow's and issues no command, so recorded histories replay as they did; the worker's build ID changes, and Worker Deployment Versioning takes it as a new build. A call that is retried passes the first try'snowon every try. pydantic-graph reads the clock once at the head of a node. On Argo, a template that reads the clock comes before each statement that readsnow, four more nodes each in E040's reckoning, so a flow near Argo's limit can come to E040. Step Functions and Lambda durable functions do not change. - E003 for a range on a type that takes none, and E001 for a line under
workflow, say more than they did; a check that matches their text sees the new text. - The pages
dandori docwrites for a flow that can end withDandori.BadInputorDandori.BadResponsechange with those descriptions.
ritsu 0.40.0(日本語)
足したこと
- sakai の E208 は、ワークフローの
implementsと同じく、規則のimplementsも確かめます。 規則が実装するサービスは、その規則を持つコンテキストの公表された言語のopen host serviceに書いてください。一つの契約のサービスを実装する規則は、契約を公表してください。published language <契約の package>の下にproto "<契約>"を書き、規則が実装するサービスをopen host serviceに並べます。規則はownsに入っていれば足ります。規則を一つずつ公表しようとして、一つの塊(E004)か一つの package(E006)でぶつかると、注がこの形を案内します。規則を一つだけ、規則そのものを中身にした塊(rulec "<規則>"。package は契約のもの)で公表する形も、そのopen host serviceにサービスがあれば通ります。 - 契約のサービスを実装する規則を
use rule … connectで呼ぶと、契約を並べた公表された言語に着き、そのサービスが公開ホストサービスなら通ります。 前は E202 でした。 sakai docは、公開ホストサービスを実装しているものに規則も並べ、規則が実装するサービスを書きます。- 契約のサービスを実装する規則で、前の
rulec genが規則のために書いた.protoが、契約のコピーと違うパスに残っていれば、rulec genはそのファイルを挙げ、消してかまわないと言います。 ファイルは消さず、終了コードも変えません。--checkでも挙げ、--format jsonは新しいキーleftに並べます。挙げるのは、一行目が rulec の頭の行(// Code generated by rulec …)のファイルだけです。 ritsu check --format jsonは、ファイルごとに、そのファイルの言語が言うことを入れます。filesの各項目の最後にcheckが入ります。そのファイルの言語のcheck --format jsonがそのファイルについて書くものから、file・root・diagnosticsを除いたもので、形はその言語のままです。kaname のモジュールならsummaryと関数ごとのeffect、帳簿ならreport、geas の仕様ならclaims、日付のファイル、ゲート、地図、モジュールの要件(そのモジュールのどの.reqにも同じもの)ならokとsummaryです。規則、.proto、地図でないコンテキストはnull、フローは{}です。ritsu check --format jsonは、確かめた境目を一つずつ並べます。bordersはheld・failed・undecidedを残し、recordsに境目を一つずつ並べます。記録の数は三つの数の和と同じです。記録には、どの確かめか(precondition、rule_date_input、range_from_koyomi、transfer_amount、transfer_refusals、hold_expiry、koyomi_date_input、secret_destination、operation_guard、workflow_permissionのどれか)、何についての境目か(about)、二つの側atとto(どちらもtool・file・line。モジュールではdependencyも)、結果(result)、ritsu が出した診断のコード(code。成り立つときはnull)が入ります。並びは語の順で、続いてatのファイルと行の順です。語は変えず、新しい確かめには新しい語を後ろに足します。- dandori の
dateとtimestampに、数と同じ場所でrangeを書けます。 場所は、ワークフローの入力と出力、レコードのフィールド、タスクの引数と結果です。端は日で、>=2026-01-01 <=2027-12-31のように書き、片方だけでもかまいません。時刻の範囲の端は UTC の日として読み、端のあとにoffset +09:00と書けば、そのオフセットの日として読みます。値は、数と同じく入ってくるところで確かめます。範囲の外の入力はDandori.BadInput、範囲の外の結果はDandori.BadResponseで実行が失敗します。比べ方はどのプラットフォームも文字列の比べです。日付は 10 文字を範囲の最初の日と最後の日と比べ、時刻は先頭の 19 文字(秒まで)を範囲の最初の秒と、範囲のすぐあとの最初の秒と比べます。23:59:59.5Zは、その秒の中の時刻として範囲に入ります。 workflowの下にnow range >=2026-01-01 <=2027-12-31と書くと、ワークフローが動く期間になります(offsetも書けます)。 期間の外で走り始めた実行は、何も呼ばずにDandori.OutOfPeriodで失敗します。範囲の外の入力と同じ扱いで、on failureは走りません。nowを読む文は、その前に時計を確かめ、確かめた時刻を読みます。期間の外なら、処理されなかったタスクのエラーと同じくon failureに入ります(リトライせず、タスクのonは受けません)。on failureが無ければ、ワークフローが失敗します。on failureとon cancelの中のnowは、時計がいつを指しても後始末が走るよう、期間で確かめません。- dandori の検査は、日付と時刻と
nowを範囲で確かめます。 範囲の検査(E014、W104)は、日付と時刻とnowを、渡す先の範囲で確かめます。期間を書いたワークフローのnowはその期間の時刻で、koyomi の日付の日は koyomi が数えた日として読みます。E015 は、子のフローの日付と時刻の範囲も、タスクの引数の範囲と比べます。案件が開いたままになる検査(W101、E020)は、nowを読む文の前の確かめを、on failureに入りうるところとして数えます。 dandori scenariosは、範囲と期間を試す実行を作ります。 日付と時刻の範囲を書いた入力ごとの、範囲のすぐ外と端(時刻は最後の秒に.5を付けたもの)の実行と、期間のすぐ外で走り始める実行と、走り始めのあとで時計が期間を出る実行です。シナリオのnowは、二つの時刻の並び[走り始め, それより後]でも書けます。七つのプラットフォームのランナーとritsu runは、どちらの時刻も読みます。dandori docは、図の頭に期間を、終わり方にDandori.OutOfPeriodを書き、どの行のnowが実行をon failureに入れうるかを言います。ritsu checkは、ワークフローが渡す日を、その出どころの範囲で決めます。 koyomi の日付の入力(E205、W205)、規則の日付の入力(E202、W202)、範囲がrange from koyomiの規則の入力(E201、W201)に渡す日です。出どころは、範囲を書いた日付と時刻、動く期間の中のnowで、時刻とnowは日付のファイルのカレンダーのオフセットで日に読みます。端の開いた範囲は、外れることがあると言います。範囲を書いた二つの日付の関係(check_in <= check_out)も、数と同じく決めます。ritsu check --format jsonの、この三つの確かめの記録(koyomi_date_input、rule_date_input、range from koyomiのprecondition)には、codeのあとに五つのキーが入ります。given、takes、from(日が来うるところの並び。種類kindはday・range・moment・now・unknown・output)、example、whyです。- dandori の請求の例は、ワークフローが動く期間を書きます。
ritsu checkは警告 6 件で全部通り、境目は確かめた 8 か所・決められない 6 か所になります。nowの W205 の 2 件が消えました。
直したこと
- 一つの文の
nowは、何度書いても、どのプラットフォームでも一つの時刻になりました。 Temporal(TypeScript、Python、Go)は、呼び出しの試しごとに走るコードの中で時計を読んでいたので、リトライした呼び出しは試しごとに後のnowを渡していました。いまは呼び出しの前で一度だけ読みます。pydantic-graph は節点の中のnowごとに時計を読んでいました。いまは節点の頭で一度だけ読みます。Argo は式ごとにnow()を評価していました。いまはnowを読む文の前に時計を読むテンプレートを置き、wait untilとtimeout untilの秒数も、一度読んだ時計から計算します。 - 参照インタプリタを Argo として流したとき、
workflow templateの子の失敗の理由を、Argo と同じく空にしました。 dandori docは、Dandori.BadInputとDandori.BadResponseを「宣言した型か範囲に合わない入力」「宣言した型か範囲に合わない結果」と説明します。
変えたこと
- rulec のスキルの
SKILL.mdは、毎回の変更の手順を持ち、一度きりの段(CI、rulec verify、rulec diff、rulec doc)はmore-of-the-loop.mdに移りました。SKILL.mdがそのファイルを指します。ritsu skills installは、新しいファイルもほかと一緒に書きます。 - kaname は、言語をまたぐ確かめを
ritsu checkと同じ語で呼びます。precondition、rule_date_input、transfer_amount、koyomi_date_inputです。kaname check --format jsonのplaces[].check、kaname apiのchecks[].check、kaname docのページで ritsu の答えを待つ場所の文が、この語を使います(振替の拒否の理由はtransfer_refusals)。前は ritsu の設計の番号X2・X3・X4・X6でした。 - 規則から生成する
.protoと同じパスに契約のコピーが来てrulec genが止まるときの文と、E076 と E310 の直し方は、genがコピーするファイルを「コピー」と言います。 ritsu のほかの文と同じ言い方です。前は「写す」と言っていました。
サイト
- トップの「言語が出会うところ」が、再現から走らせた境目の記録の JSON と、十の確かめの語を見せます。
- rulec の生成のページが、規則が契約に移ったあとに残った
.protoをgenが挙げることを言います。 - dandori のワークフローを書くと日付と帳簿が、日付と時刻の範囲とワークフローが動く期間を見せ、何を検査するかが確かめ方を、プラットフォーム別のビルドがプラットフォームごとの時計の読み方を言います。
- トップの、言語をまたぐ確かめの一覧に、ワークフローが範囲と期間から koyomi の日付に渡す日が入りました。
英語のページも同じです。
簡体字のトップページ(/zh/)が、ritsu を一枚で紹介し、残りは英語のページに任せます。リポジトリにも同じ紹介を README.zh.md として置き、README とサイトの言語の切り替えからリンクします。
前は通っていた実行が落ちうる変更
sakai checkは、規則が実装するサービスを、規則のコンテキストが公表していないと E208 にします。 契約の.protoがコンテキストのどの公表された言語にも無いときと、サービスがそのopen host serviceに無いときです。rulec "<規則>"の形でopen host serviceを書いていない地図も E208 になります。前は、規則を呼ぶワークフローだけが E207 で落ちていました。rulec gen --format jsonの答えに、いつも出るキーleftが増えます。 知らないキーを受け付けない読み手には、新しいキーになります。ritsu check --format jsonの答えに、いつも出るキーが二つ増えます(filesの各項目のcheckと、bordersのrecords)。 知らないキーを受け付けない読み手には、新しいキーになります。kaname check --format jsonとkaname apiのcheckは、X2・X3・X4・X6の代わりに語を書きます(上)。番号で読んでいた読み手には、語が来ます。ritsu explainが言う E076 と E310 の日本語の文と、上のrulec genが止まるときの日本語の文が書き直されました。 保存したものと比べる実行は、違いを見ます。- 日付か時刻に範囲を書いたフローと、
now rangeを書いたフローは、0.39.0 の dandori では E001 になります。 nowを読むフローの生成物が、期間を書かなくても変わります。 Temporal(TypeScript、Python、Go)は、nowを読む呼び出しの前で時計を読みます(const dd_now_<場所> = dd.now();など)。ワークフローの時計を読むだけでコマンドは出ないので、記録した履歴の再生は前のとおりです。ワーカーのビルドの ID は変わり、Worker Deployment Versioning では新しいビルドとして扱われます。リトライした呼び出しは、どの試しでも最初の試しのnowを渡します。pydantic-graph は、節点の頭で一度だけ時計を読みます。Argo は、nowを読む文ごとに、その前に時計を読むテンプレートが入り、E040 の見積もりが 4 ノードずつ増えます。Argo の上限に近いフローは E040 になることがあります。Step Functions と Lambda durable functions は変わりません。- 範囲を書けない型に範囲を書いたときの E003 と、
workflowの下の行の E001 の文が変わります。 文を突き合わせている検査には、新しい文になります。 Dandori.BadInputかDandori.BadResponseで終わりうるフローのdandori docのページは、その説明が変わります。