Repository navigation
Releases
v0.0.22
26 merges since v0.0.21. Some decisions were wrong in earlier releases, and this one corrects them. Arithmetic is now exact: (1 / 3) * 3 is 1, and a calculation is never rounded on the way. A value must still fit a decimal to be kept, and a very large calculation is refused. The semantics version moves from 6 to 9, so the same programme can decide differently.
It is also much faster in places: 1,440 prices under unique by, in one transact, went from 12.8 to 1.6 seconds. Migrations 033 to 035 are needed.
Decisions this release corrects
| What was wrong | Releases | Who is affected |
|---|---|---|
A rule with not over an or could accept a change that broke it (#955) |
v0.0.15 to v0.0.21 | A rule such as not ((((not X(x)) and A(x)) or B(x)) and K(x)): a top-level not, an or under it, and a condition inside one branch that reads a variable nothing has bound yet |
| The same rules could refuse a lawful change (#955, #960) | v0.0.18 to v0.0.21 | As above |
A remainder (%) by a high-precision divisor could be a wrong number, with no error (#953) |
every earlier release | A programme that takes remainders by divisors with many decimal places, including ones a division leaves. The size of the number does not matter: 4294967295 % 1.0000000000000000000000000000 was wrong. Ordinary lot and tick sizes are not affected |
| A quotient was rounded to 28 digits mid-calculation, and a step past the decimal range was an error (#962) | every earlier release | A programme that divides, or whose intermediate figures are very large |
One thing is now refused. A value no decimal holds, such as 1 / 3, can be computed and compared but not kept. Admitting or emitting it, a derived value or digest refuses it and names the fix, round. Before, it was silently rounded to fit a decimal (#962).
What to do
Two different questions, and neither answers the other:
| Question | Command |
|---|---|
| Is the historical record intact? | morpholog audit verify |
| Would this release's semantics have made the same decisions? | morpholog rehearse, on a copy of the database |
An intact record can hold a decision that was wrong.
- On the copy, run the checks in step 9 of
docs/operating.mdfor each programme, unchanged. - Read the rehearsal's report before you upgrade production. It exits zero whatever it finds. Look into every row marked
would_reject,would_errorordifferent_delta. Look intounreplayablerows too: rehearsal could not decide them again, so it says nothing about whether they were right. - Look at refusals separately. Rehearsal decides only committed proposals again, each against the state recorded before it. It cannot show a lawful change that was refused.
inspect rejectionslists the refusals Morpholog recorded, but not necessarily all of them, so check your own logs of rejected requests too. - Correct a wrong decision with an ordinary governed act. Upgrading repairs nothing, and the evidence stays as it was. If the decision already led to a payment, an order or an obligation, that needs putting right outside Morpholog as well.
Upgrading
Follow the upgrade checklist in docs/operating.md.
- Run
morpholog migrate(033 to 035). - Run
provision indexes --prune, naming every programme the database serves in that one command (#937). Aunique byover several fields now gets one index over its whole key. Indexes over one field are not rebuilt. On the gallery's programmes, the claims table went from 527 indexes to 436. - Programme hashes do not change. Every gallery programme has the same hash as under v0.0.21, and as many of its rules compile to SQL.
- Regenerate every generated view surface with
generate views, and runrefresh derivedforcacheviews. A live view that divides, generated before this release, fails and says so (#962). - Regenerate every Python client. What reaches existing code:
- A
check --jsonfinding has a requiredcode, and asubjectwhen it concerns a declaration (#669). A client from v0.0.21 or earlier refuses a report that holds any finding. A clean report still reads. provision indexes --jsongives each indexpositions, a list, in place ofposition(#937).- A passing
audit verifywith an anchor carriesanchor(#961). An older client refuses that report. - A refusal can report a number no decimal holds, as a
fraction(#962). The client reads it asvalues.Exact. - The error kind
round_out_of_rangeis gone (#962). Read a report saved under an older binary with the client generated then.
- A
- Named reads refuse a field stored as another kind than its declaration (#935). Before, the value was printed as if it were the declared kind.
check --database-urlfinds such claims. - Some figures have fewer trailing zeros (#962):
(2.00 / 3) + (1.00 / 3)was1.0000000000000000000000000000and is1. A quotient in a live view is shortened the same way. Values compare equal either way. A consumer that compares figures as text is affected. - PostgreSQL 18 is recommended where latency matters and many indexes are provisioned. 19.0 works and is tested, but plans each statement more slowly as indexes grow: an act took 9% longer with 6 indexes, and about twice as long with 434 (#964). PostgreSQL 18 stays the minimum.
- Formats: evidence packs stay format 19, the score report 6, the rehearsal report 2 and the view description 5.
For embedders
check --jsonfindings have a stable code (#669). Match oncode, not on the wording. A code keeps its spelling and meaning, and new ones appear, so accept one you do not know.- A uniqueness check finds its key directly (#937). It used to slow down as a batch grew.
- A
transactauthorises each actor once when no act in it can change who may do what (#938). On 1,440 prices that went from 1.39 to 1.19 seconds. audit verifynames the anchor it checked (#961).- After restoring onto another cluster,
migrateandcheck --database-urlwarn when the deployment's root login no longer matches, and print the fix (#935). - The embedder guide answers more questions (#930): several reads that must agree, what each rule costs, and what
--mentionssearches. - Independent cases on one database can still abort each other (#906). The guide says what to expect, and what to do when retries run out.
- The Python client's
provision_indexestakeshistory(#935).
The language
- Rules that take things in an order are fast (#933, #942). "The total of what comes before this one" and "is anything ahead of this one" are answered from one sorted list per act, not a fresh search per row. Shipping 1,600 allocations in one act took 23 milliseconds, against 4.9 seconds with that turned off.
check -vlists where it can apply. - A live view's sum can call a condition that can fail, such as the exchange rate in force (#920). One definition can now serve both a rule and a live total, when the total adds up rounded rows. Comparing timestamps is about five times faster (#967): live totals for 1,000 orders went from 5.1 to 0.9 seconds. Existing views need no regeneration for this change alone; #962 still requires it. Ordinary tables are still far faster.
check -vshows what a time grid can cost (#940).- Clearer findings: a repeated clause on a predicate is marked where it repeats (#657), and a computed value in a call's arguments gets an error that names both fixes (#935).
Safeguards
- CI runs the database tests on PostgreSQL 18 and 19 (#931).
curve25519-dalek5.1.0, for RUSTSEC-2026-0620 (#951). Released binaries never ran the affected code.
Rust API
Changed, so code that uses them needs editing:
SourceMap::span_for_errorandspan_for_lintare nowplace_errorandplace_lint, which return the declaration and the span (#669).ValidationError::DisciplineDuplicateClausegainsclause(#657).EvalError::RoundOutOfRangeis gone, andEvalValuegainsFraction(#962).IndexPlanEntry::positionis nowpositions(#937).- In the CLI crate,
CheckDiagnostic::newtakes a code and a subject (#669), andProvisionedIndex::positionis nowpositions(#937). - The
Intactverdicts gainanchor(#961), andDeploymentIdentity::Closedgainsroot_login_matches(#935).
Added: ValidationError::code, Lint::code and SourceMap::place (#669); the numeric module and EvalError::sum_out_of_decimal_range (#962); grid_costs (#940) and ordered_sums (#933); AnchorEvidence (#961).
A correction to the v0.0.21 notes
They said the InvenTree stock history tests ran "under four workers". They ran under three, in every run, before and after, so the comparison stands.
The generated Python client is regenerated and stamped v0.0.22.
Prebuilt binaries for linux (x86_64, arm64) and macOS (Apple Silicon). Install guide: docs/install.md (select by uname -s / uname -m, verify the checksum; the worked examples ship in the source archive below, no Rust toolchain needed). Intel Macs build from source - GitHub retired the free Intel runner.
main (rolling)
Rolling build of main at b10d7a2. Recreated on every merge; not a versioned release - pin a v* tag for anything durable. Install guide: docs/install.md.
v0.0.21
32 merges since v0.0.20. With the optional history index provisioned, one entity's history reads only the audit rows that mention it, not the whole audit log. On the InvenTree fork under four browser workers, the stock history pages' reads went from a median of 10.5 seconds to 0.44.
A refusal at an or of comparisons names every branch's figures. Live derived views take more of the language: max and min, a sum whose target is computed from each row or by a value definition, a domain over a condition with an or, and a choice of live or cache per derived claim. A read of one key of a live view computes that key alone. And example 27's planned GB gas-day demonstration is complete, covering nominations, trade matching, the clock change, who may do what, and cash-out.
Migration 032 is needed. The semantics version stays at 6. For a programme valid under both releases, decisions over the same state and inputs are unchanged. Two programme shapes that v0.0.20 accepted are now refused by check, as below: one failed at its first decision, and the other put a derived claim's values in the wrong columns.
Upgrading
Follow the upgrade checklist in docs/operating.md: stop every process, back up, migrate, verify the audit, check provisioning, regenerate the clients, and start on the new binary.
- Run
morpholog migrate(032). It addscompared_branchestomorpholog.rejections: a nullable list, checked to be non-empty, that never sits besidecomparedon one row. Older rows read with it absent. - Run
provision indexes --checkfor every programme. On a database v0.0.20 provisioned for every gallery programme, nothing is outstanding: all 525 indexes are kept. To read history views through the audit log's index, runprovision indexes --historyonce (#909). It is the deployment's choice, and no run prunes it. - Regenerate the views with
generate views. The view description moves from format 4 to 5. A history view now carries a condition the history index serves, and gains a lookup function per declared key,<view>_by_<key fields>(#909). Lookups are granted to no one: grantEXECUTEwhere you grantSELECTon the views. A lookup returns its view's row type, so dropping a history view now needsCASCADE. A live view is distinct on each key's column (#898); its rows do not change. checkrefuses a little more:- a comparison like
<of two timestamps in one branch of anor, through a definition's parameters (#908). v0.0.20 passed it, and the first decision failed on it; - a derived claim's
valuewhose name is not the column at its place (#872). v0.0.20 filled the columns in order whatever the names said, so such values landed in the wrong columns. No programme measured had one.
- a comparison like
- A
propose --batchrow with a field the row does not read gets aninvalid_requestreceipt naming the field, and is not proposed (#884). The rows around it run as before. Before, the field was dropped without a word, soexplain_on_rejectin a batch row looked honoured and was not. - Regenerate every Python client with the v0.0.21 binary. A client pins the binary version. What reaches existing code:
Rejected,AtomicRejected, both explanation verdicts, rehearsal rows and rejection rows carrycompared_branches(#910); an envelope carrying it andcomparedtogether is refused;- an explanation's gate verdict carries
related_parameters(#882); ViewDescriptioncarrieslookups, in format 5, andProvisionReportan optionalhistoryentry (#909);Session.processis the child a session spawned (#885);local_daysandbusiness_daysrun the calendar generators and return their rows, ready fortransact(#887).
- Gallery programmes changed. If you copied one, compare it:
- Formats: evidence packs stay format 19, the score report format 6, the rehearsal report format 2. The view description moves from 4 to 5.
For embedders
-
One entity's history, read through the log's index (#909). A history view used to expand every audit row's operations. With the index, a whole view reads the audit rows that mention its predicate, and a lookup reads those that mention one entity. On the InvenTree fork's record:
- the stock history browser tests pass under four workers, in 3.3 to 12.9 seconds, against 10.9 to 27.0 with the index alone;
- the median history read is 0.44 seconds, against 8.1 with the index alone and 10.5 on v0.0.20, over 4 successful reads;
- the page bodies are byte-identical.
Most of the gain needs the host to call the lookups: the index alone took the median from 10.5 to 8.1 seconds.
-
A refused
ornames each branch's figures (#910). A refusal at anorwhose branches are each a comparison carriescompared_branches, one{op, left, right}per branch in branch order, and nocompared.before <= cap or after < before, refused at a cap of 10, names20 <= 10and30 < 20. Anorwith a branch that is not a comparison names none. It appears on therejectedenvelopes, inexplain's verdict and prose, inrehearse, and in the rejection log, which--mentionssearches. -
A preview names the parameters a refusing gate reads (#882):
explain's gate verdict carriesrelated_parameters, as a refusal does. -
A read of one key of a live view computes that key alone (#898). On 10,000 orders and 30,000 fills, one order's figure went from about 106 to about 4 milliseconds. Only a comparison with values reaches the key:
= $1,= ANY($1),IN (...). A join,IN (SELECT ...)orLATERALcomputes every key first, on the generated view as measured (#905). So read a page's keys, then the view by= ANYof them. -
Live or cache per derived claim (#873).
generate views --derived-source <Derived>=live|cachechooses one claim's source over the--deriveddefault. A claim chosen live that cannot render refuses the run by name. -
Independent cases on one database can still abort each other (#912). PostgreSQL tracks serializable reads by index page, and unrelated cases' entries can share pages. The guide now says what makes it worse and what to do: retry. The adapter's tests pin that such an abort is a retryable serialization failure, and that the retry commits.
-
The embedder guide gains: a figure shared between a rule and a read, and the local date of an instant (#876); that the generated client carries durations and collections (#880).
The language
- Live derived views take more of the language:
- A key crosses a call and a
forall's source (#870). A value a pattern inside a called condition finds now narrows the reads after the call, and aforall's source narrows its body. A key nesting more than 64 lookups reads whole. - One evaluation computes each repeated aggregate once (#888). Within a gate, an invariant's judgement or a derived claim's rows, a
sum,maxorminkeeps its result for the same values and state. A figure used three times went from a 2.15 to a 0.77 second median. checkpasses an antecedent that calls a definition calling itself through anor(#869). v0.0.20 overflowed its stack.- Two parse errors name the rule they break (#879).
Worked examples
- 27, the GB gas day: its planned demonstration is complete. Renominations, judged on their window, effective hour and lead (#894). Trade nominations that pair, are rejected, expire on the network's own completeness evidence, or are withdrawn (#896). The clock change's outage and deferral, from National Gas's notice (#902). A receipt racing the report that the record is complete (#904). Who may do what: a Trader User nominates no flow, and the OCM operator nominates both sides of a market trade (#914). Each slice was held to an independent reference, frozen before the programme.
- 23 writes up the breakpoint form of its hourly cap (#891).
Safeguards
release.shkeeps its temporary files whereghcan read them (#890). The v0.0.20 release stopped before publishing its register record.url2.5.9 for RUSTSEC-2026-0592 (#901).- Three collecting walks use the shared fold walk (#883).
Rust API
Changed, so code that uses them needs editing:
render_viewstakes a derived source per claim, not one flag (#873).RejectedWithExplanation::newtakescomparedandcompared_branchesas one pair (#910).RejectionReason::{Invariant, Require, BindNone},RowClass::WouldReject,PgProposalOutcome::Rejected,PgAtomicOutcome::Rejected,GateRejectionandInvariantRejectiongaincompared_branches, andRejectionRowan optional one (#910). Code that builds them names the new field.
Added:
- Kernel:
ValidationError::DerivedValueOutOfPlace(#872);GateRejection::related_parameters(#882);Hashon the IR's expression types (#888). - Adapter:
ViewRefusal::NotDerived(#873);HISTORY_INDEX,HistoryIndexEntry,plan_history_index,provision_history_index,LookupDescriptionandViewDescription::lookups(#909). - CLI envelopes:
ProvisionedHistoryIndex,ProvisionReport::historyandProvisionReport::new(#909).
The generated Python client is regenerated and stamped v0.0.21.
Prebuilt binaries for linux (x86_64, arm64) and macOS (Apple Silicon). Install guide: docs/install.md (select by uname -s / uname -m, verify the checksum; the worked examples ship in the source archive below, no Rust toolchain needed). Intel Macs build from source - GitHub retired the free In...
v0.0.20
44 merges since v0.0.19. A deployment can now be closed, so that a login needs authority to assert any actor, and a host can enrol its own new users without reaching anyone else's identity. A refusal by a named gate names the act's parameters the gate reads, so a form can mark the field. A programme can be split into parts.
More rules run on the compiled route, a large act no longer exhausts the planner, and a read keyed inside one rule loads a dozen rows where it loaded thousands. And this release is the first to carry its own register record, signed.
Migration 031 is needed. The semantics version stays at 6: no decision changes for the same programme, state and inputs. Some duration spellings and some ill-kinded programmes that v0.0.19 accepted are now refused before anything is decided, as below.
Upgrading
Follow the upgrade checklist in docs/operating.md: stop every process, back up, migrate, verify the audit, check provisioning, regenerate the clients, and start on the new binary.
- Run
morpholog migrate(031). It createsmorpholog.deployment_identity, a table holding one row that says whether the deployment is open or closed. A database without that row refuses every proposal. - A migrated deployment stays open, as it was.
init,migrateandcheck --database-urlnow print a note on stderr saying so, with the command that closes it (#826). Stdout is unchanged. Closing is opt-in: see "Closed deployments" below. - Run
provision indexes --checkfor every programme. Newly keyed reads (#810) and rules that moved to the compiled route (#804) can need an index a programme did not need before. On a database v0.0.19 provisioned for every gallery programme but the new example 27, this binary needed nothing new: all 426 indexes and 9 statistics objects were kept. Your programme may differ. check,migrateandprovision indexesprint a coded error on stdout when there is no report (#850). With--jsononcheck --database-urlandprovision indexes, and always onmigrate, a failure to connect or a schema that does not fit prints one object and exits 1:{"status": "error", "code": "...", "error": "..."}. The codes areconnect_failed,not_initialised,schema_behind,schema_ahead,schema_below_baselineandschema_record_altered. Before, stdout was empty. The prose stays inerrorand on stderr.migrate --checkstill reports the schema states it can inspect in its own report. Pending migrations are whatmigrateapplies, not aschema_behinderror. A failure after migration work has begun gets no code.- A duration is ISO 8601 exact time units, or refused (#784). The friendly form (
1h 30m), lowercase designators (PT6h), fractional hours or minutes (PT1.5H) and a leading+were accepted by mistake, on the wire and in a.morphduration(...)literal. Now each is refused. A programme with such a literal no longer parses; the gallery has none. checkrefuses a little more (#815). A definition whose body is anornow holds its callers to a kind every branch agrees on. A caller passing a count where every branch needs a part was accepted before.- A closed stdout ends a command with status 141 (#811), as a shell reports for a writer SIGPIPE ended. Before,
inspect audit | headpanicked with exit 101. Forpropose, 141 means the outcome is unknown, like any other unexpected status. audit verifycounts transitions only (#812). On a database migrated through 027, it no longer counts the baseline and activation control rows, so it agrees withrehearseandevaluate.tree_sizestill counts every row.- Printed output changed in three places. Scripts that read
--jsonare unaffected.provision indexes --checkand--dry-runlist only what is outstanding, then a count of what is kept (#819).check -vsaysinvariants: 18 (9 declared, 9 from declarations)when declarations add rules (#814). Its read line is nowbody read plan: all keyed, and with--database-urla second line says provisioning was not checked (#851).
- Regenerate every Python client with the v0.0.20 binary. A client pins the binary version. What reaches existing code:
- a
Durationfield or parameter is avalues.Duration, not astr, and no longer refuses generation (#784); ClaimReadis aClaimInstanceandNamedClaimReadaNamedClaim, each adding onlyasserted_in(#849);check,migrateandprovision_indexesraiseMorphologRequestErrorwith the code above (#850);RejectedandAtomicRejectedcarryrelated_parameters(#833);check(with_database=True)and the session'sreadyline carryidentity,openorclosed(#826);init()takesroot_actor,root_loginandconfirm(#843), andaudit_checkpoint()takeswait(#820);- an explanation's
transitioncarriesdecided_at(#817); - the view description is format 4 (#832).
- a
- Gallery programmes changed. If you copied one, compare it:
- Formats: evidence packs stay format 19, the score report format 6, the rehearsal report format 2. The view description moves from 3 to 4.
Closed deployments
init --root-actor A --root-login Lmakes a closed deployment (#826). A login may then assert an actor only with anActorAssertionAuthoritygrant for that actor, or a grant for its kind (below). The root actor is different: only login L may assert the root actor A, and no claim can grant it to anyone else. The login is held by OID as well as by name, so a role dropped and made again is not the root.- An existing deployment closes with
init --skip-if-exists --root-actor A --root-login L. It first lists the actors the log records that no grant names, and stops unless--confirmis given. Stop the writers while closing. - Grants to a kind of actor (#827).
ActorKindAuthority(kind, login)lets that login assert any actorActorKindgives that kind.ActorKindEnrolment(kind, registrar)lets a host admitActorKind(x, kind)only for anxthe same act mints. So a host can enrol new users at sign-up, but never move an existing actor into a kind it may assert. On a closed deployment only the root otherwise writes these claims, and an actor holds at most one kind. - A plain
initstill makes an open deployment. To require authority for every actor, initialise or close the deployment as above.
The language
- A programme in parts (#793). A
.partsmanifest lists.morphfiles in order, and every command takes it in place of a.morph. The parts read as one text, so a programme in parts hashes as their concatenation. A part is refused where a construct could run into the next one.check --jsonplaces a finding in its own file. - A derived claim may compute nothing (#828). With no
valueclause, its rows are its keys over theovercondition: the claims that meet it. - A live derived view chooses with
if(...)(#829), and may hold a flag or a subject, not only a decimal. - A sum's body may compare, sum, and call a condition with an
oron the compiled route (#804). Rules of these shapes move from the interpreted to the compiled route, andgenerate views --derived liveaccepts them. In the gallery,settled_within_effective_termsin example 10 moved. Still refused: anordirectly in a sum's body, and a sum whose body can raise inside arithmetic. generate local-days --at HH:MMstarts each day at a local hour (#838). A GB gas day is--zone Europe/London --at 05:00, 23 or 25 hours long on the clock changes.--skippedand--repeatedchoose what a start time a clock change skips or repeats becomes. A transformation that declarestzdb_digestgets the sha256 of the zone file.
For embedders
- A refusal names the act's parameters the gate reads (#833). A refusal by a named gate carries
related_parameters: the act's parameters the gate's expression reads, directly or through the statements before it, in parameter order. It is a static dependency, not a verdict on which input is wrong. It is absent for an invariant and an unnamed gate. - Fewer rows loaded, fewer conflicts (#810). A pattern keyed in a rule now keys the patterns around it. On the InvenTree spike at 5,000 records,
allocateloaded 12 rows where it loaded 14,335, and 16 concurrentcomplete_orderacts retried 0.6 to 0.8 times per commit, from 6.7 to 7.5. - A large act plans in linear memory (#797). A check bound to hundreds of cases held each case as an
ORarm, and planner memory grew with their square. An InvenTreeshipof 750 allocations ran the database out of memory at 24 GB; it now takes 250 MB and 3.1 s. explainanswers for an act that readsdecided_at(#817). It judges the act at its read transaction's start, and names that instant.audit checkpoint --covering ID --wait 30sretries for up to 30 seconds while the transition is outside the stable prefix, then records the checkpoint. If the wait runs out, it gives the same codedtransition_not_coveredrefusal as before (#820).- The view description names a key for every view it can stand behind (#832). A predicate with no
unique byis keyed by all its fields. A key holding a timestamp or a duration is left out, since a view column holds microseconds; the exact_morpholog_argumentscolumn stands in. - A compiled check that added two sums, each through a definition with a list test, failed every proposal with a SQL error (#824). Fixed.
- A hostless database URL reaches the socket of the port it names (#798), not the default port's.
- The embedder guide gains: seeding a ledger once and copying it per test with
createdb -T, and what a copy shares (#8...
v0.0.19
32 merges since v0.0.18. A host has less to write. More of what it used to restate now lives in the programme: a branch, a pass over every matching claim, a figure named once, a typed parameter, and a gate that follows a tree up through a condition that calls itself. A rule can range over a grid built from a claim's bounds, and a commitment can be held to its reveal. Writers conflict less: more reads load only the rows a decision names, not a whole predicate. And generated views do more of the reading: they describe themselves, compute derived claims live, and show each predicate's history.
No migration is needed. The semantics version moves to 6: a receipt decided under 5 reads not_re_evaluated from this release's verifier, never a mismatch.
Upgrading
- No migration. The schema head is still 030, so this binary runs on a v0.0.18 database as it is.
- Run
provision indexesagain for every programme. The new keyed reads (#732, #738, #769) and live derived views (#741) seek on positions that v0.0.18 did not index. Without the indexes the reads stay correct but scan, and concurrent proposals conflict as before.provision indexes --checksays what is missing. - Decisions move: semantics version 6 (#718). A value admitted into a claim, or emitted into an intent, must be of the kind its field declares. Before, a subject could land in a
Datefield, a bare decimal in aDecimal[USD]one, or a quantity in another unit, and the claim contradicted its own programme. Now each is a kernel error naming the field (claim_kind_mismatch,intent_kind_mismatch), and nothing is written. Claims already stored that way are untouched. - A decimal is admitted as written, or refused (#761):
- a tagged decimal written
1e10,+1,01or1.is refused, as the named codec already did; - a decimal with more than 28 fractional digits, or a coefficient past 96 bits, is refused, where before it was rounded.
- a tagged decimal written
checkrefuses more.- A definition named like a bare-word builtin (
if,periods,period_index,period_start_of,digest) is refused by name (#755). - Under
--strict, two new hints fail a programme that passed before: a sum calling a definition with a wildcard argument (#748), and a sum holding anorwhose branches can hold together (#751).
- A definition named like a bare-word builtin (
- Regenerate every Python client with the v0.0.19 binary. A client pins the binary version. What reaches existing code:
- a commit's receipt carries
drawn_subjects, required (#765); - every
kernel_errorcarrieskind, and the client refuses one without it (#718); invalid_argumentscarriesparameterwhen one argument is at fault (#766);- the rehearsal report is format 2:
would_errorrows carrykind(#718); - the client's decimal reader and writer refuse what the binary refuses (#761).
- a commit's receipt carries
- Session and
serveerrors are shorter (#766). They no longer suggest runningmorpholog schema, and no longer name the server's file. One-shot commands keep the hint. - A large record may need a PostgreSQL setting (#769). Under SERIALIZABLE, every read leaves predicate locks. They block nothing. But once one transaction holds more than 32 of them under the claims table, PostgreSQL replaces them with one lock on the whole table, and conflicts between unrelated proposals become more likely. With sixteen allocators on a 50,435-part tree, 7 of 8 runs at the defaults retried 0.45 to 0.51 times per commit; with
max_pred_locks_per_transaction = 256they were about 0.2. On that machine, at 100 connections, the setting took 6.7 MiB more shared memory. It needs a restart. The embedder guide says how to tell whether a deployment needs it. #772 tracks the wider question. - Building from source needs Rust 1.100 (#770). Release binaries are built by 1.100.0, and now check integer overflow instead of wrapping silently (#775). A reachable overflow would panic, and would be a kernel defect. None is known.
- Gallery programmes changed. If you copied one, compare it:
- Formats: evidence packs stay format 19, the score report format 6. The rehearsal report is format 2. The description
generate views --describewrites is new, at format 3.
The language
if/elsein a transformation (#753). Only the branch taken runs.ifandelseare not reserved words.for Pattern(...)(#754): one pass per claim the pattern matches, in the canonical order of the claims' arguments, so every platform runs them alike. Its read is keyed.- A definition that names a figure (#755):
define allocated(item) = (sum(...)), read wherever a value stands. - A parameter's declared kind (#756):
transformation cancel_order(order, force: Bool). The schema and the client type it. A wrong-kind argument is the kernel errorargument_kind_mismatch. - A condition that calls itself (#768, #769). A
definemay call itself, directly, in shapescheckcan bound. That lets a gate follow a tree where the record holds only each node's parent. Loops in the data end. Mutual recursion is still refused. A rule that reads one is checked whole on every change to what it reads. Only a gate that walks one link up from a known node loads just the chain above it. - A rule ranges over a grid (#757):
forall h in periods(start, end, duration("PT1H")), on the interpreted route. digest(...)(#758): asha256:subject over values, so a sealed bid can be held to its reveal. The Python client computes the same digest.- Smaller things:
For embedders
-
Fewer conflicts between writers that touch different rows. A read is now keyed:
- by a value an earlier
bindfound (#732). On the InvenTree spike, retries fell from about 5.5 to 0.31 per commit; - by the elements of a list argument (#738);
- up a tree from a known node (#769).
check -vmarks a whole read of a predicate the same act writes (#730). - by a value an earlier
-
Generated views:
-
Receipts:
drawn_subjectslists every subject an act drew, in order, including any that reached no admitted claim (#765).parameternames a malformed argument (#766).kindclassifies a kernel error (#718). -
One view for every write (#728): the embedder guide shows a single host view that serves every write a family exposes. It uses an allow-list of names, passes the body through, takes the actor from the login, and gives each outcome its own HTTP status. The InvenTree spike measured it.
-
The compiled route hands an invariant to the kernel when a stored value drifted from its declared kind. It used to give a kernel error (#719).
-
A load past PostgreSQL's parameter limit widens its keys, and is refused before it is sent if it still cannot fit (#740).
Worked examples
- 25, stock allocation (#753 to #756, #768): shipping visits every allocation, splitting or whole. A line takes stock of any variant below its part, and the gate follows the variant tree.
- 26, sealed bids (#758): a bid is a digest, and the reveal is held to it.
- 23, delivery hour limits: hourly prices on a grid (#757).
Safeguards
- The kernel's purity check now reads resolved paths, so a renamed import of the clock, the environment, the file system or the time-zone database is caught (#774). It is a tripwire, not a proof.
- A match in the kernel names every variant it handles, so a new construct is a warning at every place in the kernel that must decide about it (#771).
- A dependency update in this repository takes only releases at least a week old (#770).
Rust API
Changed, so code that uses them needs editing:
Definition::bodyis aDefinitionBody, not aProp(#755).Prop::Intakes aValueExprsource, not aTerm, andLint::LargeGridnames itsowner, not itstransformation(#757).Builtin::arity()andValidationError::BuiltinArity::expectedare anArity, not ausize(#758).ReadFilter::resolvepairs each position with aKey, not a value (#732, #738, #769).render_viewstakes aDerivedSourceand a history flag (#741, #750).- In the CLI's envelopes,
ErrorReceipt::newandRequestError::newtake the error's kind, andTracedError::newtakes theEvalError(#718). - The lexer's
Token::ReservedBoolLitisToken::BoolLit(#730).
Added:
- Language:
Stmt::If,Stmt::ForEach,TraceEntry::{If, ForEach},ForEachIterationTrace(#753, #754);DefinitionBodyandValueExpr::Defined(#755);Transformation::declared_kindsanddeclared_kind()(#756);Value::Bool(#730);Builtin::Digestandpub mod digest(#758);Definition::calls_itself,RecursionRefusal,Widening::RecursiveCall(#768). Each has anir_builderconstructor:if_,for_each,value_definition,defined_value,transformation_typed,in_grid. - Errors:
EvalError::{ClaimKindMismatch, IntentKindMismatch, ArgumentKindMismatch},EvalError::kind()andKINDS,EvalValue::kind(),PredicateArgKind::holds(), andkindonRowClass::WouldError(#718, #756); newValidationErrorvariants for definitions, declared kinds, grids and recursion;Lint::{WildcardedCallUnderSum, OverlappingOrUnderSum}(#748, #751);parameterandnaming()on the CLI'sErrorReceiptandRequestError(#766). - Reads:
Key(withOneOfandReached) andKey::reads_any(),KnownTerm::{Field, Element, Reached},Link,MAX_ELEMENT_KEYS(#732, #738, #76...
v0.0.18
28 merges since v0.0.17. A caller that runs arbitrary code can now propose without holding the rules or the logins: morpholog serve keeps both behind a Unix socket, an executor role can only deliver what was admitted, and a transformation reads its decision time from the runtime, never from the caller. Rehearsal and the case-local check no longer scan what a change did not touch, so a long record re-decides in seconds. As-of reads can start from a kept snapshot instead of the first row.
Two plain migrations are needed; neither is the staged kind that pauses writers. The semantics version moves to 5: a receipt decided under 4 reads not_re_evaluated from this release's verifier, never a mismatch.
Upgrading
- Run
morpholog migrate. Migrations 029 and 030 are pending for a v0.0.17 database. 029 records an executor role beside the writer and reader, and narrows the writer's grant on the outbox: it keepsINSERTandUPDATEon the delivery columns, and loses table-wideUPDATE, so no provisioned role can change an admitted intent (#701). 030 adds the two tablesrefresh snapshotskeeps (#377). Neither rewrites history. A v0.0.17 binary refuses the migrated database as ahead of it. - A role prefix is now at most 55 characters, so
<prefix>executorfits PostgreSQL's name limit. It was 57. A deployment with a longer prefix moves to a shorter one withroles move, which also adds the executor;init --skip-if-exists --least-privilegeadds it to a deployment that keeps its prefix. - Decisions move: semantics version 5 (#673). The case-local check now seeks only the cases a change touched. Two decisions change. A rule whose antecedent errors on a case the change did not touch no longer errors the proposal; a touched erroring case still errors, and a failing case is refused rather than lost behind the error. And a rule whose
exists,forall,not, nested rule or sum reads a case variable's name before the rule has bound it is now checked whole: version 4 bounded it to a case the scope never read, so it could admit a change that left a broken obligation unchecked. Over the shared corpus no admission or refusal moved. Refusal witnesses moved in one shape: aunique byrule's refusal now binds the claim being admitted to its first pattern's variables and the claim already held to the second's.evaluate's scoring iscase_bound_admission_v6. decided_atis a reserved name (#378). A programme that uses it as a parameter, alet, aforor quantifier binder, or in a pattern matched against stored claims is refused bycheck, by name; rename the variable. It is never silently rebound. Example 13 renamed its own.- Regenerate every Python client with the v0.0.18 binary. A client pins the binary version, so a v0.0.17 client refuses this binary at its first call. What reaches existing code:
- rehearsal rows carry
model_hash, and an unreplayable rowbecause, withtotals.unreplayable_because(#667); the strict models refuse unknown keys by design; init's report carriesexecutor_role(#701);- new:
connect_service()andSession.connect()forserve(#700),refresh_snapshots()and itsRefreshSnapshotsReport(#377).
- rehearsal rows carry
- Gallery programmes changed. If you copied one, compare it:
- Evidence packs stay format 19, the rehearsal report format 1, the score report format 6. No programme hash outside examples 07 and 13 moves.
The language
decided_at(#378): a timestamp a transformation body reads, given by the runtime likeactor. It is the start of the transaction deciding the act, which the act's audit row records ascommitted_at; a replay, live or from a pack, gives each row that instant back, and a refusal's explanation replays it. It is the logical decision time, not the moment of evaluation or commit, and not the moment the SERIALIZABLE snapshot is taken: a transaction that waits after it began is decided as of its start. Only a transformation body reads it; for a rule to read a time, admit the time. A retry is a new decision at a new instant. Decision times are not in log order, and a gate on time is not a seal against a race: to order a bid against a close, admit the close as a claim and gate the bid on its absence, and even then the order is SERIALIZABLE's logical one, not the wall clock's.explain, which has no recorded instant, refuses a body that reads it;--explain-on-rejecthas one.check -vnames the body reads that load a predicate whole (#396), with the statement, its rule and the definitions it went through. A read is keyed only by what the act knows before it runs. A gate summing terms in force through the selectoreffective bygenerates reads every key's terms; a definition keyed by a parameter does not.
For embedders
morpholog serve(#699): the resident runtime on a Unix socket. The programme is pinned by a required--expect-hash;--presenter UID=LOGINmaps each caller's OS user to its own database login, checked before the service listens; an unmapped caller is closed before anything is read; reads and explanations need--grant. The wire is the session's, unchanged.session --expect-hashpins the stdio session the same way (#666).- The executor role (#701):
init --least-privilegeprovisions<prefix>executor, which reads the outbox and moves a row through delivery and nothing else: it cannot change an intent, read claims or audit, or propose. Give it to the process that holds an external key. - Rehearsal at scale (#673, #677, #683, #688, #689, #691, #692). A rehearsal of forty thousand register rows was stopped after more than eight minutes before this cycle's work; a hundred thousand rows now take two to five seconds on the same laptop. The case-local check seeks its cases instead of scanning, the candidate is a view over the pre-state, a replay's state is kept for the fold, and several quadratic paths in the kernel are linear. Measured figures are in the bench README.
rehearsereports progress on stderr every ten thousand rows (#672). morpholog refresh snapshots(#377) keeps the admitted state after every--everyrows of the log (default 10,000), and an as-of read replays only from the nearest one. On a 146k-row record with two thousand live claims, a read at the end fell from 4.8 seconds to at most 0.34. Run it on a schedule. The snapshots are a cache, never evidence: a read with none replays the log, and no verifier, pack, rehearsal, score or receipt reads them. A large live set gains less.- What
rehearseandevaluatere-decide against. Unchanged in this release, and worth restating: the prefix each row is decided against is the recorded effects applied in the one audit order, the order of effects, not the state each decision saw. A proposal that read a claim, then committed after another that removed it, sorts after the removal, so re-deciding it can find the claim gone. For a serial history the two coincide.rehearsereproduces effects exactly; it does not reconstruct a concurrent decision's own context (#644).decided_atfollows the same rule: each row's recorded instant is given back, so a decision time can be earlier than a row before it in the log. - Operator checklists (#665): a new page,
docs/operating.md, lists the steps for upgrading, deploying a changed programme, closing a day, keeping as-of reads fast, serving callers you do not trust and running the executor, each linked to its explanation.
Worked examples
- 07, chess: a tutorial that runs against a released binary, and one move action (#694, #695).
- 13, biometric identification oversight: verifications and decisions are dated by the runtime, so the two-people-first rule checks the order of events, not the account of the person acting (#378).
Rust API
Term::DecidedAt;Transition.decided_at(not serialised);EvalError::UnboundDecisionTime;ValidationError::{DecisionTimeNotAvailable, DecisionTimeAsName, DecisionTimeMatched};RecordedProposal.committed_at;RejectionStateOutcome.decided_at(#378).ReadPlan::whole_readsandWholeRead(#396).refresh_state_snapshotsandSnapshotRefresh(#377).SEMANTICS_VERSIONis 5;Widening::ScopeReadsBeforeBinding(#673).- Rehearsal:
RecordedProposal.model_hash,RowReport.model_hash,RowClass::Unreplayable { because },Unreplayable,UnreplayableTotalsandTotals.unreplayable_because(#667);rehearse_candidateandrehearse_candidate_against_packtake a progress callback,RehearsalProgress(#672);rehearse_recorded(#675). - State and decision:
Stateis no longerClone, and the candidate is a view,Candidate(#677);Decided,decide_staged_delta_withandadvance_recorded(#679);State::admits(#680);State::layering,Layeringandapply_compacting_when(#681);State::apply_replayed(#683). session_login(#699). The executor in the role records:DeploymentRoles::executor,RolePair.executor,RoleMembers.executor,MovedLogin.executor,DeploymentRoles::same_deploymentandlisted_roles(#701).
The generated Python client is regenerated and stamped v0.0.18.
Prebuilt binaries for linux (x86_64, arm64) and macOS (Apple Silicon). Install guide: docs/install.md (select by uname -s / uname -m, verify the checksum; the worked examples ship in the source archive below, no Rust toolchain needed). Intel Macs build from source - GitHub retired the free Intel runner.
v0.0.17
28 merges since v0.0.16. The audit log has one order. Every transaction takes one place in it when it writes its first audit row, and every row records what its commit did to the claims table, so replay rebuilds the table exactly even when writers overlapped. A read as of a timestamp follows that order too. Arithmetic is exact: +, - and * return the mathematical result or refuse, where they used to round, and the compiled checks compute arithmetic and builtins in SQL with the kernel's values. A new command, rehearse, re-decides every committed proposal under a candidate programme. Two generators write a year of calendar days as proposal rows.
Three migrations are needed, and one of them pauses writers, so read Upgrading before you deploy. The semantics version moves to 4: a receipt decided under 3 reads not_re_evaluated from this release's verifier, never a mismatch. No programme hash moves.
Upgrading
- Run
morpholog migrate, with a procedure. Migrations 026, 027 and 028 are pending for a v0.0.16 database. 026 and 028 add SQL functions and take no lock of note. 027 is the canonical order: it adds columns, indexes and a Merkle pass over the existing history with the database in service, then one cutover that holds every writer while it writes the baseline (measured 3.6 seconds at three hundred thousand live claims and 22 at two million; readers are never held). The install guide's "Running the migration to the canonical order" gives the steps: back up,migrate --checkfor the preflight (legacy rows, estimated preparation and pause, anything that refuses the cutover now),migrate --prepareahead of the window and again just before it,migratein the window, thenaudit verifyandaudit checkpoint. A plainmigratewith no window does all of it in one run. The cutover refuses a prepared transaction left open or a session the login cannot see, by name; fix that and run it again. Interrupted at any point,migrateresumes. A v0.0.16 binary refuses the migrated database as ahead of it. - Decisions move: semantics version 4 (#616).
+,-and*over decimals and quantities now refuse where they used to round half to even into the digits that fit:1e-28 * 0.5was0, the largest decimal plus0.4was unchanged, androundcould return a figure that was not a multiple of its quantum. A result that fits is unchanged, digits included, so a rule over ordinary figures decides as before. A transformation whose arithmetic used to round now errors, whichproposereports as a kernel error, not a rejection. To find them before anyone does: after the migration, runmorpholog rehearse <your programme>with the programme you serve, unchanged. Read the report as a diagnostic, not a proof. A row reported aswould_erroris a proposal that errors under this binary when re-decided against the audit prefix before it, and under the same programme the arithmetic is the likeliest cause; but the prefix is the order of effects, not the state each original proposal saw while writers overlapped, so a row can also error or differ for that reason, and a row the record cannot replay, an act the programme no longer has or arguments it no longer takes, isunreplayablerather than judged. Look at eachwould_errorrow's reason before concluding anything about it. The known limit: a product of two wide figures, about twenty-eight significant digits in total, refuses where it rounded; rounding the operands first is not the same figure, and a rounded multiplication waits for an example that needs one. Division keeps its rounding rule. Audit rows and receipts stamp the version they were decided under; a verifier on another version saysnot_re_evaluated. - Regenerate every Python client with the v0.0.17 binary. A client pins the binary version, so a v0.0.16 client refuses this binary at its first call. Three contract changes reach existing code:
writer_rolesis gone fromaudit(),audit_named()andaudit_checkpoint(), as--writer-roleis gone from the binary: the watermark reads the lock table, so it needs no view of other sessions and no assertion of who writes (#632). A call that passed it is aTypeError.deadlock_detectedis a new proposal-row code besideserialization_failure(#626): PostgreSQL chose this transaction as the victim of a lock cycle and nothing was recorded.retriableis true for both, andenvelopes.RETRIABLE_CODESis the list. A v0.0.16 client refuses the receipt as an unknown code, which is the safe side.- Audit rows written since the migration carry
audit_order,act_ordinal,ordered_atandoperations(#632); the strict models refuse an unknown key by design. The new models:Ordering,Operation, the rehearsal report family,ActivationPreflight,ReplayIndeterminate,ReplayConflict,TreeActivationFaulty. New methods:rehearse(), andmigrate(prepare=True).
- Scripts that pass
--writer-roletoinspect auditoraudit checkpointfail at argument parsing. Drop the flag; the lossless resume no longer needs it. - The tail's rows change shape. Rows from before the migration are as they were. The migration itself writes control rows at the first order:
morpholog.baselinechunks, thenmorpholog.activate, each with the attestation{"mode": "migration"}. They are not transitions of any programme: coverage,evaluateandrehearseskip them, and--as-ofa chunk's id is refused with the record's id to use instead. A projector that dispatches on transformation names sees them once. A fresh database has none. - Evidence packs are format 19 (#632). This release verifies format 19 and format 17, which v0.0.15 and v0.0.16 wrote, when every row of a format 17 pack is from before the order. A v0.0.16 verifier refuses a format 19 pack as unsupported. Format 18, which only development builds wrote, is refused by name. Keep old packs with the release that wrote them, or export them again.
audit verifyhas a third replay verdict, and it is not corruption. The report carries two verdicts: the tree verdict, which says whether the log up to its latest checkpoint still matches its checkpoints (a rewrite that also rewrote the checkpoints is caught only against a checkpoint you hold outside the database, and rows after the latest checkpoint are not yet covered), and the replay verdict, which says whether replaying the log rebuilds the claims table.consistentanddivergentas before, and nowindeterminate: a legacy history whose replay does not reach the baseline the migration recorded, which two legacy writers overlapping before the order existed can lawfully cause, since their rows were sorted by transaction start. The two are judged apart: anindeterminatereplay beside a passing tree is not itself evidence of an edit, only that the pre-migration order cannot be told apart from the table. Rows written since the migration replay exactly. Adivergentreport now listsconflicts, such as a delete of a claim the history never held, which is what to read first.audit verify-packholds a complete-prefix pack to the activation's shape,activation_faultyotherwise.--as-of <timestamp>needs the primary (#645). "As of t" is the state after every transition placed in the order at or before t. The reads settle the instant against the orders still held on the connected server, so a standby cannot answer one; a transition id still can. An instant later than the last settled row while a writer is in flight is refused as not settled; retry once that writer finishes. The same holds for--afterwith a transition that is not yet settled.evaluate --train-until <timestamp>selects by the same order, and its report is format 6.- No programme hash moves. The twenty-four gallery programmes hash the same under the v0.0.16 binary and this one, checked side by side. The canonical encoding is unchanged.
- Index plans are unchanged. Planned with the v0.0.16 binary and with this one, each on its own database, the whole gallery needs the same 371 indexes and 9 statistics objects, by name. The compiled arithmetic adds no seek. Run
morpholog provision indexes --check <programmes>after the migration as the upgrade sequence says. checkmay newly hint.BindOnlyToRetract(#614): abindwhose fields are read by nothing but theretractthat follows, where the kept fields cover a uniqueness key, can be the pattern formretract Row(row: row, ..), which has always matched and retracted every hit. Arequirekeeps the refusal abindgave on no match. A hint failscheck --strict.- Gallery programmes changed. If you copied one, compare it:
- example 02 gains replay guards on its two revenue acts and refuses a reused id (#620);
- example 08 takes one result per screening and refuses a stale result moving the pointer back (#623);
- twenty-six acts across nine examples that sent a notice and could be accepted again unchanged are now refused, and seven ids or notices that could stand for two records are disambiguated, in 03, 06 and 13 among others (#621);
- example 24 is new (#612).
The language
- Exact arithmetic (#616). The syntax sheet always promised exactness, and a
sumthat did not fit refused; now+,-and*do the same.round(v, q)computes over exact integers and is judged on the multiple it selects: an unchosen candidate or the doubled remainder outside the range is no reason to refuse. Nothing in the surface changes. - No new construct. The erratum (#534) is an idiom: an append-only claim about a claim,
RecordedInError(claim_id, reason), naming the recorded line by its own identity, with rules reading the line through a definition of standing. The retract by key (#390) was always there; the syntax sheet shows it now. The generated grid stays in transformation bodies.
For embedders
morpholog rehearse <candidate.morph>(#521), against the d...
v0.0.16
23 merges since v0.0.15. Rules can now range over the hours, or any fixed periods, of an interval: periods(from, until, step) builds the grid inside the rule, and a rule says how long a window may be before the grid is built. Unary minus arrives as plain sugar, a definition can be called by the names of its parameters, and a literal in a programme is a parsed value rather than text, so two spellings of one value are one programme. That last change moves the programme hash of any programme whose literals were not already in their canonical spelling. A moved hash touches the generated client's startup check and the derived SQL views, so read Upgrading before you deploy.
No decision changed: the semantics version stays 3. No migration is needed: a v0.0.15 database is current. The generated client gains typed methods for scoring, guarantees, a covering checkpoint and session-side explain, and it decodes quantities with their unit, which is a change to what your code receives.
Upgrading
- No migration. The schema is unchanged since v0.0.15;
morpholog migrate --checkreports the database current. A v0.0.15 database serves this binary as it is. - Some programme hashes move. A literal is now a value, and the canonical encoding is 2 (#600). A programme whose literals were already in their one spelling keeps its hash; one that wrote
span(P1Y),duration(PT90M)or a timestamp with an offset gets a new hash, because those are now the same programme asspan(P12M),duration(PT1H30M)and the instant inZ.1.50and1.5stay two literals, since a figure computed from one keeps its scale. In the gallery only the charging-years example moved. What to do:- run
morpholog hashon each programme you serve with the new binary and compare it with the hash you pinned; update any deployment metadata or external reference that names the current programme by hash; - regenerate every generated Python client with the v0.0.16 binary whether or not the hash moved (below); where it moved, a client generated under v0.0.15 refuses the programme at its first call, and a resident session refuses to open, so start new sessions and drain the old ones;
- derived SQL views. A generated view reads only the derived cache rows written under its programme hash. Where the hash moved, run
morpholog generate views, apply the new views, thenmorpholog refresh derivedfor that programme; until the refresh, the regenerated views return no rows. This touches read projections only, never admitted claims or audit history. The embedder guide has the sequence; - keep the old hash and the programme as released under it wherever it admitted transitions. Audit rows keep the hash of the programme that admitted them,
audit verifyis unchanged, and the new hash is a new identity under the new encoding, not a sign that any decision changed. Do not rewrite historical hashes to the new value.
- run
- The formatter rewrites spellings.
P1Yprints asP12M,PT90MasPT1H30M, an offset timestamp as itsZinstant, and0 - xas-x(#600, #601). A programme committed byte-exact from the formatter's output can change with this binary while its meaning does not. checkmay newly fail.- A decimal the exact type cannot hold, a date that does not exist or a malformed instant is a parse error at its span (#600). Before, such a literal was accepted and silently matched nothing, or failed later.
check --database-url <url>andcheck --against <file>(#575) are new and refuse a programme that no longer fits the stored claims or a sibling programme's declarations; they run only when asked.- A
periodsgrid without its window gate or with a computed step is refused by name (#603); a grid whose gate still allows more than ten thousand periods is a hint, which failscheck --strict. checkno longer reportsEmptySumUntyped(#597): the checker types every empty sum, and a hand-built seed it disagrees with isSumSeedNotFaithful, naming both.
- Validation widens on two shapes, and some input contracts change (#595, #597). An empty sum whose target the old pass could not type, an outer-bound quantity or a builtin over a duration, was refused and now validates, with the typed zero (
0 t,PT0S). A parameter used inp + sum(...) <= 10is now typed Decimal, and one used inp <= cap * 2with aDecimal[t]cap is typedDecimal[t]; if your programme has either shape,morpholog schemaand the generated client's models change accordingly. - Regenerate every Python client, with the v0.0.16 binary, whether or not the programme hash moved: a generated client pins the binary version as well as the programme hash, so a v0.0.15 client refuses this binary at its first call. Several envelopes also gained fields, and the strict models refuse an unknown key by design:
needed_byon each index of the provision report (#578),rowon the session's explanation (#591),below_baselineonmigrate --check(#574), the newguaranteeenvelope (#579), thecheckpoint_refusalenvelope (#589). Two behaviours change for existing code:-
a tagged quantity decodes to
values.Quantity(amount, unit)on claim instances, audit rows, witness and compared values, where v0.0.15 gave a bareDecimaland dropped the unit (#564). Generated intent payloads still give the amount asDecimal, after checking the unit. Where code read a quantity field:# v0.0.15 amount = claim.args[2] # Decimal("100"), the unit lost # v0.0.16 quantity = claim.args[2] # Quantity(Decimal("100"), "MWh") amount, unit = quantity.amount, quantity.unit
The field index is illustrative. Check the unit rather than discard it;
-
audit_witness(...)andaudit_checkpoint(witnesses=[...])raiseMorphologWitnessFailedwhen a timestamp authority fails after the checkpoint was stored (#592). Before, the client returned the checkpoint as a success and the witness was silently missing. The checkpoint is recorded, not rolled back:exc.checkpointis the head as stored, with every witness that did arrive, andexc.retriableis true. Retry withaudit_witness(tree_size, witnesses)against the same tree size; a proof already stored is not stored twice, and nothing records a second checkpoint.
-
- Index plans. Planned with the v0.0.15 binary and with this one, each on a fresh database, the index requirements of the twenty gallery programmes both can parse are identical: 286 indexes and the same statistics objects. The three programmes v0.0.15 cannot parse (10, 15 and 23, for the named definition call, the unary minus and the grid) bring the whole gallery to 23 programmes and 339 indexes. The report's new
needed_bynames the rule behind each index, so a new line after an upgrade explains itself (#578). Runmorpholog provision indexes --check <programmes>before writes resume, as the install guide's upgrade sequence says. - Gallery programmes changed. If you copied one, compare it:
- example 15 gains a credit note, reversing a billed line with its figures negated (#601);
- example 19's hash moved with the encoding (#600);
- every pattern with three or more wildcards is spelled by the fields it reads, across twelve examples (#601), with no hash change;
- example 10's selector call is spelled by its parameter names (#594), with no hash change.
The language
- A grid over instants (#603).
periods(from, until, step)is the start of everystep-wide period that meets the half-open window[from, until), as a collection of timestamps, anchored at the Unix epoch in exact nanosecond arithmetic. A rule that must hold in every hour of a trade writeslet hours = periods(starts_at, ends_at, duration(PT1H))and ranges overhourswithforallorsum, or directly withfor. A window off the grid meets one period more than its length holds, so alignment is one identity:(until - from) / step = sum(1 | h in hours). The grid's size is the rule's own: the step is a literal, and the call must followrequire until - from no_longer_than duration(...)with a literal bound, earlier in the same transformation. Validation refuses it otherwise, and no kernel constant caps the count. A loop binder over a grid is a timestamp before its first use. No zone and no calendar: a local day's bounds enter as a claim, and a 23-hour day gives 92 quarter-hours with no special case. Grids live in transformation bodies; an invariant over a generated grid waits for the rule that forces it. - Unary minus (#601).
-xis0 - x, nothing more: no new node, decimals only, and-100is a subtraction over the literal, never a signed literal, so a claim argument still takes no sign. The formatter prints0 - xback as-x; the hash is unchanged. - A definition is called by the names of its parameters (#594),
trade_terms_in_force_on(trade: trade, as_of: d, ..), a generatedeffective byselector's included. The IR stays positional, so no hash moves. - A literal is a value (#600). The IR holds parsed decimals, dates, instants, durations, spans and quantities, read once at the source. A text the type cannot hold is a diagnostic at its span, never rounded in.
- One kind inference (#595, #597, #598, #599). The static checker is the one place kinds are inferred: it owns the parameter contract that
schema,generate python-clientand--args-namedread, types every empty sum, and validation keeps the contracts it observed so reading one is a lookup. Decisions did not move.
For embedders
check --database-url <url>(#575) compares the programme with the claims the database holds: a stored claim with another arity, kind or unit is an error on the declaration, and a stored predicate nothing declares is a hint.check --against <file>refuses a predicate two programmes declare differently, with no database. Pythoncheck(with_database=True). The guide's dep...
v0.0.15
33 merges since v0.0.14. Admission is more selective: an old violation no longer necessarily blocks a change to records it does not touch. That changes some decisions, so the semantics version moves from 1 to 3. Refusals also say more. They carry the bindings at the point of failure, and when the failure is a comparison, its operator and the two values compared, so an application can explain a refusal without redoing the rule's arithmetic.
This release also replaces the evidence-pack formats with one, format 17, makes the generated Python client check the type of every value it decodes, and lets a deployment move to roles of its own. Existing databases need migrations 024 and 025. If you use a generated client or keep evidence packs, read Upgrading before you deploy.
Upgrading
-
Start from v0.0.14. This binary carries only the migrations after v0.0.14's schema (#516). A database that does not record v0.0.14's migration 23 is refused by name; upgrade it with a v0.0.14 binary first.
-
Stop every process on the database, back up, then run
morpholog migrate.docs/install.md("Upgrading an existing database") has the whole sequence. Two migrations are new:- 024 drops the rejection log's rule that only an invariant refusal carries a witness, since a gate refusal now carries one too.
- 025 adds
rejections.compared.
A v0.0.14 process started after the migration is refused before its first query, because the database is ahead of it.
-
Then provision indexes, and check them. Run
morpholog provision indexes <programmes>for every programme the database serves, thenmorpholog provision indexes --check <programmes>before writes resume;--checkchanges nothing.migratenow ends with a hint naming the check (#549). Planned with the v0.0.14 binary and with this one, each on a fresh database, the gallery's index requirements are identical: 21 programmes, 319 indexes and 91 statistics objects. That does not show your programmes are unchanged: a rule withorin its consequent now compiles (#544) and can need more indexes.Order(o, d) implies (Approved(o) or Waived(o))went from one index to four. -
Some decisions differ: the semantics version is now 3. For the same programme, state and proposal, this release can decide differently from v0.0.14. Both changes narrow what admission checks:
- a change that touches none of a rule's reads no longer checks that rule, and arithmetic, an extremum or a builtin over bound terms no longer widens a rule to the whole state (#529);
- an
orin a consequent no longer widens a rule's cases (#544).
So a proposal v0.0.14 refused because of an old violation the proposal did not touch can now be admitted. Version 2 was never released.
-
Evidence packs and receipts from v0.0.14. There is one pack format now, 17, for every kind of pack (#517).
- A pack written by v0.0.14 is reported
unsupported_pack, naming the format it carries: its evidence is not checked. Where you still have the database, export the pack again; a v0.0.14 verifier cannot read a pack this release writes, so upgrade verifiers with the database. - A receipt issued under v0.0.14 stays tied to semantics version 1. Export its evidence again at the receipt's own checkpoint and the evidence verifies, but the evaluation reports
not_re_evaluatedand the receipt does not pass. Only a release that implements version 1 re-evaluates it. - So keep your v0.0.14 packs, and a v0.0.14 binary to verify them. A holder of a pack without the database cannot export it again, and this release does not verify the older formats.
- A pack written by v0.0.14 is reported
-
Python 3.12 is the floor for the generated client (#516).
-
Regenerate the Python client. Several envelopes gained fields:
witnessandcomparedon refusals,asserted_inon claims reads,casesincheck --json, andrefusalsin coverage. A client generated before refuses them by design. The client is also stricter (#559). Malformed output raisesEnvelopeErrorfrom an envelope andCodecErrorfrom a generated model, where it used to pass through or raiseTypeError. A session error receipt with a code the schema does not publish now poisons the session. -
checkmay newly fail.checkfollows the runtime intonot,implies,existsandforall, and refuses a programme whose binding flow can raise an unbound variable at runtime (#547).- Two new hints can fail
check --strict(#532): a rule that re-checks history when a figure changes, and a field or parameter name the Python client would refuse.
-
Gallery programmes changed. If you copied one, compare it:
- example 12's
fromandtoare nowstarts_atandends_at(#532); - example 13 records one deployment and enforces who may act (#552);
- example 04's approval acts take only the document's id (#553);
- two permanent events in 13 and 17 are
append only(#532).
Their programme hashes moved.
- example 12's
What a refusal says
- A refused gate carries its witness (#531): the bindings at the part of the gate that failed, from the same walk that renders the trace, never the actor. It is on the rejected envelope, batch and session receipts, the rejection log and
explain. - A refusal carries the two values its failing comparison compared (#537):
comparedwith the operator and both values, kept only when they fail the comparison. It is on every refusal kind,explainand the rejection log (migration 025). explain's invariant verdict carries the witness too (#542), held to the refusal's by a test.checknames the rules a change may check whole (#540).check --jsongives each invariantcases:bound, orwholewith the construct responsible.check -vprints them.- Coverage names what refused (#546). Each transformation's coverage lists
refusalsby kind and rule, summing toproposals_refused. Names this programme does not declare get their own section in the prose.
Admission
- Arithmetic no longer widens a rule, and a change outside a rule's reads leaves it unchecked (#529). A rule over
preis still checked, since it judges the change itself. orin a consequent compiles, and bounds (#544), as the last conjunct of the consequent or as a definition body. A conjunct after it is refused by the compiler asdisjunction_shape, and the rule stays interpreted.
For embedders
morpholog roles move(#558) moves a deployment from a shared role pair to roles of its own, in one transaction. It moves only the logins you name, keeping their inherit andSET ROLEsettings. It refuses and changes nothing when the old roles hold more than Morpholog's floor in this database, belong to another role, or whenPUBLICholds privileges the floor would revoke.install.mdcovers it, including how to tell whether a move committed when the reply was lost.--mentions <subject>(#543) oninspect auditandinspect rejections, andmentions=on the client, keep only the rows that name a subject: in an audit row's arguments, claims or intents, or a refusal's arguments, witness or compared values. The actor is not searched.- Claims reads name the transition that made each claim present (#551):
asserted_inoninspect claims, the session'sclaimsand the client's reads. Read now, it is the claims table's own column, whichaudit verifydoes not check. Read--as-of, it comes from replaying the audit log. - The session answers
audit,rejectionsandping(#545). The protocol is still 1. - The client's
init()takesrole_prefix(#548). - The generated client is type-true (#559). Every parsed envelope holds the types its annotations declare, and the whole package type-checks under the pinned mypy in CI. It also passes a pinned ruff with no suppressions (#543).
audit verifyreports progress on stderr (#554) every ten thousand transitions.- New guidance in the embedder guide:
- the resident session behind a web server, measured at about half the time per proposal of a one-shot
propose(#555); - a deadline sealed by a witnessed checkpoint (#418);
- why
checkpointreports two shapes (#556); - how to read names for audit rows written before parameter names were recorded (#557);
- keeping personal data out of the record, and what that does not cover (#560).
- the resident session behind a web server, measured at about half the time per proposal of a one-shot
Evidence
- One pack format, 17, for every kind (#517), described under Upgrading. Each manifest names its kind and the release that wrote it.
- Witnesses (#515): a token whose signer's key is of another family than the signature it names is now
invalid, where v0.0.14 saidunsupported. An ECDSA or SHA-224 algorithm identifier carrying parameters the standard forbids isinvalidtoo.
Tested more thoroughly, unchanged in behaviour
Tests now pin the following. No behaviour changes:
- Outbox: a delivery lost to a worker crash is delivered again as the same intent, with the same idempotency key and payload, and the redelivery adds no audit row, claim or intent (#560). Delivery is still at least once.
- Calendar: property tests check the calendar laws through the evaluator (#560).
Worked examples
- 21, closed-loop execution (#518). An untrusted agent proposes orders, a custodied executor places them, and the venue's own report comes back as claims. A derived read exposes an order nobody authorised.
- 13 enforces the trust boundary its README described (#552), and 04 decides an approval's route from the record (#553).
Documentation
docs/surface-syntax.mdshows every form of the language once, and a test parses each block (#538).- A correctness pass made the docs say what the code does today (#539).
- The case-width hint says what a respelling does, and a pin is the
hashfield ofmorpholog hash(#513).
Rust API
v0.0.14
32 merges since v0.0.13. The headline: every commit now records the hash of the programme that admitted it, the version of the semantics that decided it and the fresh subjects it drew, so a past decision can be reproduced exactly, given the programme and the semantics the record names; and each deployment's least-privilege roles are its own.
Upgrading
-
Stop every process on the database, back up, then run
morpholog migrate.docs/install.md("Upgrading an existing database") has the whole sequence. Four migrations are new:- 020 adds
audit.model_hash: the canonical hash of the whole programme that admitted the row. - 021 adds
audit.semantics_version: the version of the rules' meaning that decided it. It is only allowed on a row that has a model hash. - 022 adds
audit.drawn_subjects: the subjects the act drew fromnew Subject(), in draw order, as a JSON array of strings. It is only allowed on a row that has a semantics version. - 023 adds
morpholog.deployment_roles, which records this database's least-privilege roles. A database whose fixedmorpholog_writerandmorpholog_readerhold the floor by direct grant has them recorded. Grants throughPUBLICor another role do not count.
None of the audit columns is backfilled: older rows keep their earlier Merkle leaf encodings and stay
NULL, as they must. - 020 adds
-
Stop every process before migrating; the database does not do it for you. A v0.0.13 process started after the migration is refused before its first query, because the database is ahead of it. One left running from before cannot commit a proposal: each new audit column comes with a constraint that leaves existing rows alone and refuses every new row without it. But a running outbox worker checks the schema only when it starts, and marking a delivery writes no audit row, so it can go on delivering. Migrate once, then start every process on the new binary. Rollback is restoring the backup.
-
Test suites that forge audit rows in raw SQL must now give each new row a
model_hash, asemantics_versionanddrawn_subjects(an empty array when the act drew none). A forged row without them is refused at insert. -
Name your columns. Column order in Morpholog's tables depends on the database's history, so a migrated database orders them differently from a fresh one. Replace any positional
INSERTorSELECT *over Morpholog's tables with named columns. -
Least-privilege deployments: migrate before
init --reset --least-privilege.init --least-privilege, with or without--reset, now refuses before it creates or drops anything whatever it could not provision afterwards (#503), a connecting role that may not create roles included. A reset of a database that has not reached migration 023 is refused namingmorpholog migrate: migrating records the existing pair, and the reset then binds them again. -
Roles shared between databases.
migratenow applies the privilege floor only to the roles this database records, not to whichevermorpholog_writerthe cluster holds. It warns when those roles also hold privileges in another database, as deployments provisioned before this release can.docs/install.md("Moving a deployment to its own roles") gives the steps. -
Regenerate the Python client. The audit rows,
check_report,init_reportand every verification report changed shape (below). A binary the client cannot start, such as a wrongMORPHOLOG_BIN, now raisesMorphologErrorinstead ofFileNotFoundError. -
Upgrade every verifier with the database. A pack that discloses a row written by this release carries a pack format version a v0.0.13 binary refuses as newer than it understands, before reading a row. Packs of older rows keep their old versions and stay readable to older verifiers.
-
check --strictmay newly fail. Two hints are new: a rule whose case is wider than the claim it guards, and a variable arequirematched being named again. Eight gallery rules were respelled for the first of them, which moved five gallery programme hashes; re-pin any you pinned. -
generate python-client --checknow fails on stray files in the output directory (__pycache__apart), so a CI step over a directory with extra files will go red.
What a commit records
-
The programme that admitted it (#447).
audit.model_hashis the same hashmorpholog hashprints: the whole programme's identity, unaffected by comments or layout. A row is now a join key back to the exact rulebook. The audit row envelopes carry it, andAuditRowrefuses unknown fields from now on. -
The semantics that decided it (#458, #459). The kernel names its semantics version, and a fingerprint test holds it: a change that gives a different answer to an unchanged question must move the version. Verifying integrity does not need the named version; it reads bytes, not the evaluator they name.
-
The subjects it drew (#448, #466). Fresh subjects are now an input to the kernel, not something it makes, and every durable commit records the ones its act drew, in order. With the programme the hash names and an implementation of the semantics version, the record holds every other input a replay needs. An explanation of a refusal replays the draws of the run that refused.
-
Each field is in the Merkle leaf, so the leaf moved to versions 4, 5 and 6, chosen by which fields a row carries. Each pack kind gained one format version per step:
Pack Before Programme Semantics Draws Complete prefix 4 5 9 13 Window 2 6 10 14 Selective 3 7 11 15 Single document 1 8 12 16 A pack's version is set by the newest row it discloses, and verifiers refuse a version above or below that.
-
The programme hash's encoding is frozen (#460). Freezing it moved no existing programme's hash (the gallery hashes above moved because their sources changed); a new construct may only add rendering for itself.
Proofs and evidence
- Receipts (#462).
audit receipt <file.morph> --pack <pack> --derived <Predicate>turns a derived read into a receipt, andaudit verify-receiptrecomputes it from a complete-prefix pack. It checks every layer: the evidence, completeness, the checkpoint, the programme, and the evaluation. It exits non-zero unless every layer holds. Window and selective packs are refused, since a derived read needs the whole prefix. The client hasaudit_receipt()andaudit_verify_receipt(). - Every verification report says whether it passed (#468).
verify_report,pack_verification_reportandreceipt_verification_reportlead withpasses, and the exit code is the same answer from the same rule. It means this invocation passed every check it was asked for. Among witnesses, only aninvalidone fails it;untrusted,unverifiedandunsupportedsay what could not be established. - FreeTSA witnesses verify (#470). freetsa.org signs with ECDSA on P-384 over SHA-512; its witnesses were
unsupportedand are nowverifiedunder its root (unverifiedwithout anchors). Path validation now checks a certificate with its issuer's key type, and carried certificates are judged by the bytes the token holds. - A path this build cannot check is
unsupported, notuntrusted(#498). Path search tries every issuer under a name. A path blocked only by a signature this build cannot check (a P-521 issuer, for example) makes the witnessunsupported. It isuntrustedonly when every path was judged and none validated. The search is bounded, since a token chooses the certificates it carries. - Known limitation (#499): a token whose signer's key is of another family than the signature it names (an ECDSA key and an RSA signature, say) is reported
unsupported, notinvalid. It never counts as verified. - A complete-prefix pack is NDJSON whatever its file is called; readers go by content. Window and selective packs are single JSON documents.
For embedders
- Each deployment's least-privilege roles are its own (#484).
init --least-privilege --role-prefix acme_createsacme_writerandacme_reader, grants them this database only, and records them. The default prefix,morpholog_, gives the old names.initrefuses a role name that already exists unless this database records it.migratenever creates a role and refuses if a recorded one is gone.init_report'swriter_roleandreader_roleare now the deployment's actual names, no longer fixed strings. The generated client'sinit()cannot pass a prefix yet (#501). check --jsonreports each invariant's route (#445):invariantslists every invariant ascompiled, orinterpretedwith the reason it did not compile. The client'sCheckReportgains the field and aroutesummary.provision indexes --check(#467) changes nothing and exits non-zero unless every index and statistics object the programmes need is in place: a deploy step can gate on it. The client hasprovision_indexes(check=True)andProvisionReport.is_current.- Typed
submit_all(#482) on the client and the session submits several requests as one decision overtransact. Requests satisfy an exportedRequestprotocol, and CI checks the client and session with a pinnedmypy, including that a generated request model is accepted and anything else refused. - The client's pins are contract (#436):
expected_versionandexpected_model_hashonMorphologandSessionare pinned surface, and a proposal that never started is an operational error, not an unknown outcome. - Diagnostics are coloured only on a terminal (#492), and never when
NO_COLORis set to a non-empty value, so a pipe or a log gets plain text. docs/embedder-integration.mdnow has a table of every proposal error code, with what it means and whether to re-submit, held to the binary's list by a test.