Repository navigation
Releases: GregoryGelfond/morphe
Release list
morphe 1.0.8
No user-facing changes: the house style and the command-line surface behave exactly as in 1.0.7. Upgrading from any 1.0.x is safe — a file morphe already accepted formats to the same output.
Internal
- The pinned
themelios-syntaxrevision advances to keep current with the tier'smain. The advance carries a program-tier addition only — a newAnswerSetalias and a multi-partProgramconstructor inthemelios-program, which morphe does not depend on. Thethemelios-syntaxsurface morphe consumes is byte-identical across the bump and the resolved behaviour is identical; the bump is deliberate and carries no API or behaviour change.
See the CHANGELOG for the full history.
morphe 1.0.7
No user-facing changes: the house style and the command-line surface behave exactly as in 1.0.6. Upgrading from any 1.0.x is safe — a file morphe already accepted formats to the same output.
Internal
- The pinned
themelios-syntaxrevision advances to adopt additive changes in the syntax tier'sfusionmodule (a single-home keyword roster and punctuation formation, and fuller module documentation). The surface morphe consumes is unchanged and the resolved behaviour is identical; the bump is deliberate and carries no API or behaviour change.
See the CHANGELOG for the full history.
morphe 1.0.6
No user-facing changes: the house style and the command-line surface behave
exactly as in 1.0.5.
Internal
- The lowering now reconciles two adjacent separators by joining their two
independent axes — whether each breaks, and its flat spacing — rather than by a
single ordering that conflated them and needed a hand-written special case. The
reconciliation is total by construction and behaviour is unchanged. (#9) - The design of record's per-construct spacing catalog is completed: theory-atom
interiors, the absolute-value bars, the..interval, the align-vs-nest rule a
broken chain follows, and a wording fix distinguishing the always-spacednot
from the hugged unary operators — each now stated, and the..and
absolute-value rules pinned by house-style goldens. (#edge's post-keyword space
is recorded as a known inconsistency deferred to a future major, #10.)
morphe 1.0.5
Fixed
morphe --reorderno longer fails with an internal error on a program that
reorders any statement while carrying a#script … #end.whose body has trailing
spaces or tabs before#end. morphe re-emits such a body with those blanks
trimmed (its value), but the permutation proof compared the body's raw text, so
it saw the held#scriptbarrier as moved and refused its own correct output
(exit70). The proof now reads each token's content through the syntax tier's
own projection — a script body by its value — the same rule the layout
certificate already applies, so the barrier certifies and the reorder succeeds.
Formatting without--reorderwas never affected.
Internal
- Rebuilt against a newer
themelios-syntax, adopted by a deliberate rev-bump.
The tier's public surface was regularized — comment attachment now yields a typed
comment where it yielded a bare token — and morphe reads the same underlying
token from it, so comment placement, the layout, and the certificate are
unchanged.
morphe 1.0.4
Fixed
- A long theory atom (
&sum { … }) that overflows the line now breaks at its
operators — one operand per line, each10 * cost(a)whole — instead of
overrunning the width or breaking inside a term. Where every operator in the
run is a standard term operator, morphe groups the run by their precedence and
breaks at the loosest level present; a run carrying any other operator breaks
between its terms. Long regular operator chains (X = 10 * a + 10 * b + …) and
disjunction heads (a | b | …) break the same way, and a theory guard's
operand stays indented as a continuation of its atom's line. Layout only — the
certificate and idempotence are unchanged, so a file morphe already accepted
formats to the same tokens. (#1)
morphe 1.0.3
Seven formatter defects fixed. The house style and command-line surface are otherwise unchanged from 1.0.1.
Fixed
- A
#script(lang) … #end.with an empty body (only blanks or tabs) no longer refuses to format with exit70: the whitespace-only body is emitted as a single space, which keeps itsSCRIPT_BODYtoken while its value stays empty. #minimize/#maximizeno longer emit a line one character past--line-width: the terminating.is now counted in the brace group's fit, so the group explodes at the boundary instead of overrunning it.- A bare set
{ … }used as a rule-body element now drops to its own line when the rule breaks (one body element per line), instead of staying flat beside its neighbour. - A nested argument list carrying a trailing block comment now explodes one argument per line when it overflows, and stays stable under re-formatting.
notis now always spaced from what follows:not -pandnot { b }were renderednot-pandnot{ b }.- A leading block comment
%* … *%now stands on its own line directly above its statement. - A blank line before a directive's
%!documentation is no longer repeated between the documentation and the directive.
Also recorded: 1.0.2 (a build-source patch that pinned themelios-syntax to a GitHub rev, no behaviour change). See CHANGELOG.md.
morphe 1.0.1
A patch release — test-only hygiene, nothing for consumers to do.
morphe's test names now hold to one proposition each: three names that welded two independent propositions are split into separate one-proposition tests, and two that appended a rationale clause now carry it in a comment instead. The remaining long names are each a single proposition and are kept — length alone is no fault.
No change to the library or the CLI: no API, behaviour, or output change. All suites are green — unit, integration, and the out-of-band clingo differential.
morphe 1.0.0
The first release — and the version is a promise: the house style and the
command-line surface are stable now, and anything that breaks either bumps the
major. morphe formats the clingo/clingcon dialect of ASP (and its ASP-Core-2
variant) the way rustfmt, black, and ruff format their languages — one fixed
style, a single knob — with one guarantee that sets it apart.
- It will not write output it cannot certify against its input. Before
writing a byte, morphe re-parses its own candidate and proves it stands in the
right relation to the input: by default token-stream equivalence — the same
statements and comments, in the same order, differing only in whitespace (and,
unless--preserve-spellings, synonym spellings). If the proof fails it writes
nothing and exits70. Checked, not asserted. --reorderproves a permutation instead of same-order equivalence. It
reorganizes top-level statements into a canonical signature order —#defined,
#const, rules,#show— holding order-sensitive statements and#includein
place as barriers, and proves the result a pure permutation of the input. The
one meaning-affecting toggle,[unsafe] reorder_includes, hoists an#include
on your assertion that it is pure; morphe cannot verify that, and says so in a
note rather than silently.- One fixed style, a single knob. No options to argue over: the only dial is
--line-width(default 100), and--dialectselectsclingoorasp-core-2.
Comments are carried to the anchors the parser gives them, never transposed. #scriptbodies stay verbatim unless you opt in. Python (via ruff) and Lua
(via StyLua) reformatting is behind build-time features, off by default; each
backend runs behind a hardened boundary and carries its own tool's guarantee,
not morphe's certificate.- A command line built for CI and editors. Format files, directories, and
stdin; in-place writes are atomic, so an interrupted run never truncates a
source.--checkand--diffwrite nothing and exit1on a change. A
directory honours.gitignoreand--exclude; configuration is amorphe.toml
discovered by walking up, where an unknown key is a usage error, not a silent
drop. - It formats; it does not rewrite. No semantic transformation, no evaluation,
no grounding, no solving — those belong to other tools. The certificate covers
the ASP program; the embedded seam has its own posture in
docs/security/threat-model.md. - The guarantee is exercised, not just written. Property tests for
idempotence, the certificate grant, comment placement, and the permutation; a
fuzz target; and a differential against clingo itself.
Getting it. morphe is not yet on crates.io — it depends on themelios-syntax
by path — so build from source, cloning the two repositories as siblings. Rust
1.97+ (edition 2024). The README lists every option.