Skip to content

Releases: GregoryGelfond/morphe

morphe 1.0.8

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 23 Sep 22:44

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-syntax revision advances to keep current with the tier's main. The advance carries a program-tier addition only — a new AnswerSet alias and a multi-part Program constructor in themelios-program, which morphe does not depend on. The themelios-syntax surface 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

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 21 Sep 22:03

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-syntax revision advances to adopt additive changes in the syntax tier's fusion module (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

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 10 Sep 14:00

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-spaced not
    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

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 10 Sep 11:36

Fixed

  • morphe --reorder no 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 #script barrier as moved and refused its own correct output
    (exit 70). 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 --reorder was 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

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 06 Sep 03:26

Fixed

  • A long theory atom (&sum { … }) that overflows the line now breaks at its
    operators — one operand per line, each 10 * 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

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 05 Sep 18:48

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 exit 70: the whitespace-only body is emitted as a single space, which keeps its SCRIPT_BODY token while its value stays empty.
  • #minimize / #maximize no 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.
  • not is now always spaced from what follows: not -p and not { b } were rendered not-p and not{ 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

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 02 Sep 21:53

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

Choose a tag to compare

@GregoryGelfond GregoryGelfond released this 25 Aug 03:39

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 exits 70. Checked, not asserted.
  • --reorder proves 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 #include in
    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 --dialect selects clingo or asp-core-2.
    Comments are carried to the anchors the parser gives them, never transposed.
  • #script bodies 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. --check and --diff write nothing and exit 1 on a change. A
    directory honours .gitignore and --exclude; configuration is a morphe.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.