Skip to content
docs
Arxo ↗

Complete independent stages together

For LLMs6 sections

I want one event to complete independent reviews and then join their results.

The example does not claim that a force-of-law act contains such a model.

Incorrect form
// Один носитель якобы может и завершить ветви, и выполнить Finish.

One atomic step is allowed in independent regions. Finish reads the state before its carrier; a join needs the next event, and join all needs both regions to be completed.

Arxo Law
language "law.core" version "0.2";
package recipes.k.r04 version "0.1.0";
namespace "urn:recipe:k-procedures:04";
entity Application;
event Tick { }
procedure ReviewProcess(app: Application) {
state Review initial parallel {
region Legal {
state LegalPending initial;
state LegalDone terminal;
transition LegalApprove { from LegalPending; to LegalDone; on Tick; }
}
region Finance {
state FinancePending initial;
state FinanceDone terminal;
transition FinanceApprove { from FinancePending; to FinanceDone; on Tick; }
}
join all;
}
state Done terminal;
transition Finish { from Review; to Done; on Tick; }
}

P and Q in the table are different instances; E1/E2/E3 are carriers with an explicitly given time. All identifiers and instants are pinned in the scenes.

Events and factsQuestionAnswer
empty parallel historytruth(current_state(P,LegalPending))truth_status == TRUE_ONLY; / COMPUTED
one review and a join attempttruth(current_state(P,Done))truth_status == NEITHER; / COMPUTED
branches completed by one eventtruth(current_state(P,FinanceDone))truth_status == TRUE_ONLY; / COMPUTED
join by the next eventtruth(current_state(P,Done))truth_status == TRUE_ONLY; / COMPUTED
no data about the second reviewtruth(current_state(P,FinanceDone))truth_status == NEITHER; / COMPUTED
branches and join on one carriertruth(current_state(P,Done))issue(CARRIER_REUSED); / fatal; results: []; runner expected FAIL
empty parallel history joins nothing
Arxo Law
test "empty parallel history joins nothing" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),LegalPending));
expect truth_status == TRUE_ONLY;
expect evaluation_status == COMPUTED;
}
single expertise leaves join undetermined
Arxo Law
test "single expertise leaves join undetermined" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), LegalApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), Finish, Tick { id: "urn:recipe:k-procedures:04:E2", time: @2026-09-03T09:00:00Z });
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),Done));
expect truth_status == NEITHER;
expect evaluation_status == COMPUTED;
}
one event completes both branches
Arxo Law
test "one event completes both branches" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), LegalApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), FinanceApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),FinanceDone));
expect truth_status == TRUE_ONLY;
expect evaluation_status == COMPUTED;
}
follow-up event completes the join
Arxo Law
test "follow-up event completes the join" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), LegalApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), FinanceApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), Finish, Tick { id: "urn:recipe:k-procedures:04:E2", time: @2026-09-03T09:00:00Z });
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),Done));
expect truth_status == TRUE_ONLY;
expect evaluation_status == COMPUTED;
}
missing second expertise leaves neither
Arxo Law
test "missing second expertise leaves neither" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), LegalApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),FinanceDone));
expect truth_status == NEITHER;
expect evaluation_status == COMPUTED;
}
branches and join on one carrier refuse
Arxo Law
test "branches and join on one carrier refuse" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), LegalApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), FinanceApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), Finish, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),Done));
expect issue(CARRIER_REUSED);
expect evaluation_status == NON_EXECUTABLE;
}

Counterfactual: join all; is replaced with join any;. The presented events are the same.

join any passes after one expertise
Arxo Law
test "join any passes after one expertise" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), LegalApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), Finish, Tick { id: "urn:recipe:k-procedures:04:E2", time: @2026-09-03T09:00:00Z });
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),Done));
expect truth_status == TRUE_ONLY;
expect evaluation_status == COMPUTED;
}

Swapping two independent attempts does not change the atomic-step node.

reordered attempts keep step bytes
Arxo Law
test "reordered attempts keep step bytes" {
given {
context {
legal_time @2026-09-13T09:00:00Z;
decision_time @2026-09-13T09:00:00Z;
knowledge_time @2026-09-13T09:00:00Z;
timezone "UTC";
}
assert procedure_instance(entity_ref("urn:recipe:k-procedures:04:p"));assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), FinanceApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });assert attempted_transition(entity_ref("urn:recipe:k-procedures:04:p"), LegalApprove, Tick { id: "urn:recipe:k-procedures:04:E1", time: @2026-09-02T09:00:00Z });
}
evaluate truth(current_state(entity_ref("urn:recipe:k-procedures:04:p"),FinanceDone));
expect truth_status == TRUE_ONLY;
expect evaluation_status == COMPUTED;
}
Python
>>> import runpy
>>> check = runpy.run_path("docs/recipes/k-procedures/resources/check.py")
>>> check["check_parallel"](https://github.com/arxohq/law/blob/master/docs/recipes/k-procedures/4)
'К4: общий префикс, атомарный шаг, join any и снятие токенов проверены; lawc = lawref'
Python
>>> import runpy
>>> check = runpy.run_path("docs/recipes/k-procedures/resources/check.py")
>>> check["check_fatal"](https://github.com/arxohq/law/blob/master/docs/recipes/k-procedures/4)
'К4: fatal и пустой results проверены; частичной истории нет; lawc = lawref'

Mutation check — LDC-E1345.

Original fragment:

Output
join all;

Replacement:

Output
join quorum(3);

Scenes with a condition removed are marked separately; the same inputs get a different outcome.

On join any, exit also removes incomplete tokens, publishing left_state for active nested states. Absence of completion is NEITHER, not a proven failure. An arbitrary custom predicate is not supported in the join.

In the scene “branches and join on one carrier” the named expect evaluation_status cannot execute: the document contains fatal CARRIER_REUSED and results: []. The sidecar expects a runner FAIL, and the adapter requires the exact code, severity fatal, empty results, and absence of procedure_history/step. This is a regular order refusal, not a semantic defect.

Documentation for Arxo. Writings — blog.arxo.io.

Anonymous visit counts on stats.arxo.io, no cookies.