Skip to content

Features for architecture optimization - #45

Merged
nk-coding merged 152 commits into
mainfrom
nk/sync-2026-11-03
Nov 3, 2026
Merged

nk-coding merged 152 commits into
mainfrom
nk/sync-2026-11-03

Conversation

@nk-coding

Copy link
Copy Markdown
Collaborator

Lots of features, bugfixes and improvements for the architecture optimization with palladio.
Short overview:

Features

  • External functions: scripts can call functions written in Kotlin plugin services, with records, opaque classes, sessions and named arguments
  • Model transformations: other transformations can be called (signatures, imports, path imports, in/out declarations), plus collections, for-in loops, if call and pinning inputs
  • MT diagram: declarations on the start/end nodes, a target-model selector, and editing calls, loops and assignments in the diagram
  • Optimizer: crossover (variation = genetic), operator arguments and model inputs, with config language support
  • Mutation operator generation rewritten after Burdusel et al. (swap, refinements, shown as text)
  • Metamodel views
  • Metamodels can be split over several files, and multiple inheritance is supported
  • Layouts: TALA, layered layouts that leave room for edge labels, and a layout picker after Auto Layout
  • Optimizer report: hypervolume and best constraint violation per generation
  • tmux dev scripts to run the whole stack on the host

Bugfixes

  • Generated operators: no double containment, dead creates or one object in two roles
  • MT engine: injective bound objects, numeric casts, null unsets a property, lambda traps fixed
  • No endless rebuild when an imported file is missing
  • Type system: the inference cache is cleared when class types are removed
  • Plugin boundary: session, deadline, reconnect and error-shape cases fixed; internal errors no longer leak to callers
  • Edge layout is kept when a diagram changes structurally
  • Prod compose: the execution services get the correct API base

Improvements

  • Match planning: matching starts from bound nodes, the graph is shuffled lazily, the composition DAG is cached, and two expensive Gremlin strategies are removed
  • File data: batched reads, concurrent requests share one computation, and HTTP/WebSocket traffic is compressed
  • The workbench file tree loads breadth-first
  • Docs and samples added for every feature above
  • Dependencies: Kotlin 2.4, Ktor 3.6, Gradle 9.8, Langium 4.4, GLSP 2.8, TypeScript 6, VitePress 2; published orthoflow 0.1.0 used

Adds sessions to plugin targets, external implementations of contributed functions, the script-functions protocol, and Kotlin modules for writing contribution plugin services.
Parameter and return types were added to the global table and then remapped again through the contribution's own types array, which lost them for any contribution whose array did not line up.
nk-coding and others added 25 commits October 22, 2026 11:56
A deployment of components on servers: two mutation operators (move.mt
with a required input that the config passes, swap.mt), a two-parent
crossover (take-tier.mt, `in donor: model` with a scope block and an enum
input), a variadic one (follow-donors.mt, `in donors: List<model>` and
`for d in donors do`), and a config with `variation = genetic`, a
crossover block and `with { }` arguments, two entries of one file each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Callable transformations are rewritten for `import "f.mt" as alias` and
the header's `in` / `out` lines; a new section documents model inputs:
the `model` type and where a model value may appear, scope blocks and
their read-only rules, no links between models, element inputs and
outputs as objects of the transformed model, correlation through
attributes, loops over List<model> and calls passing models. Reserved
words and "not yet supported" are updated (configuration arguments now
point to `with { }`), and the graphical editor section covers «in donor»
tags and the In Model menu. The forbid/require tip names the Change
Modifier menu, which replaced Move to Block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`using … with { }`: literal kinds and number conversions, validation,
one operator per entry, labels in the results. The crossovers block and
what makes a crossover operator; the crossover { rate parents strategy }
block; `variation` is mutation or genetic. How genetic makes offspring
(rate per group, one child per parent with cyclic donors, operator
choice and fallback, mutation of every child, no failure record,
replicated donors), per-algorithm behaviour, the PAES restriction,
step = 0, evolutions counted in evaluations, and the crossover metrics
of summary.md and report.json. A crossover example config is embedded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two entries of one file with the same arguments share a label, so keying
report.json's perOperator by label let one overwrite the other. It is now
keyed by the operator's id (operators.crossovers gives id and label), and
plot traces whose labels collide get the id appended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step counts were not checked: negative values and interval(5, 1) were
accepted silently. Counts must not be negative (0 applies no mutation step),
and since interval(lower, upper) draws from [lower, upper), upper must be
above lower.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s toolbox group

A box above the start node shows the file's name, its path imports and its
`in` / `out` declarations, one row per header line as written. A row is
edited in place (a new name or alias is renamed wherever it is used, the
object an optional element input pins included; the label edit validator
checks the shape, that the name is free and that the file still parses with
the line) and deleted with Delete or by emptying it (deleting a declaration
also deletes the pattern nodes referencing it as an object, like deleting an
instance does). Markers of a line land on the box. The box is part of the
layout (an edge only the layout sees places it above the start node) and a
box new to a laid-out diagram is put above the start node; generated
transformations have none.

The toolbox gets a Declarations group: Input, Output, Model Input and Model
List Input add a prefilled row with a fresh name and start editing it (the
line goes after the imports, inputs before outputs); Import… opens a dialog
choosing the transformation and the alias, which defaults to the camel-cased
file name. The palette also lists the models new pattern instances can be
created in, for the toolbox's target-model selector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…osing brace

When the closing brace of a scope starts its line, the content was inserted
between the brace's indentation and the brace, which left a line holding
nothing but that indentation (or, without a blank line before the content,
indented the content twice). It now goes before the brace's line. Braces at
the start of a line without indentation and braces sharing a line with
other text are inserted at as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… toolbox

Below the creation modes, the toolbox offers "Create in": the transformed
model or one of the model values the server lists with the palette items
(the `model` inputs, and the variables of loops over `List<model>` inputs).
The selected model travels with the toolbox request like the mode. In an
input model, which is read-only, create and delete are disabled; a new
instance goes into the target match's scope block of that model (a new
`in donor { }` when it has none), in forbid / require mode into a new
`forbid { in donor { … } }` block; a loop variable is only accepted inside
its loop. Add Instance offers the objects of the selected model only (the
transformed model's no longer include donor objects). Ghosts carry the
«in donor» tag.

Pattern instance nodes know their model, so the editor refuses to draw a
link between models; reconnecting a link end to a node of another model is
refused like creating such a link already was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The editor's stylesheet has no radius, font family or text size scale, so
`rounded-*`, `font-mono`, `font-semibold` and `text-sm` produced nothing. The
box gets its rounded corners and the rows their monospace font inline, like
the call node, and the title is `font-bold`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctor

The graphical editor section no longer says the header is not drawn: it
describes the header box (rows per import and declaration, editing with
renames, deleting and what goes with a deleted declaration, markers), the
Declarations group (prefilled rows, where the line goes, the Import…
dialog and the derived alias), and "Create in" for pattern objects of an
input model (scope blocks, forbid / require, disabled Create and Delete,
Add Instance, loop variables only inside their loop), and that links
between models can be neither drawn nor reconnected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er box

The header box is gone (with its layout edge and its placement above the
start node). The start node lists the `in` declarations, and every
successful end (the end after the last statement and each `stop`; a `kill`
discards the result) lists the `out` declarations, one editable, deletable
row per declaration as before: the same label edit, validation and delete
handling, re-hosted. A node with rows is drawn as a box with its symbol at
the top; without rows it keeps its plain symbol. All ends show the same
declarations; the rows of the primary end (the end after the last
statement, else the first `stop`) carry the declarations' own ids, so that
markers of an output land there, and the others derived ids that resolve to
the same declaration. A row only declares in its node's direction. Imports
are no longer drawn.

The Declarations toolbox items add their rows to the start node (inputs)
or the primary end (outputs) and start editing them there; Output is
missing when the transformation never ends successfully.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The graphical editor section describes inputs on the start node and
outputs on every successful end (not on `kill`), the box drawn for nodes
with rows, editing and deleting rows, where markers show, where the
Declarations items add their rows, and that imports are not drawn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are removed

The class types of a metamodel are registered by the first document that
imports it. When that document is processed again (opened in the editor,
edited), its class types are removed from the type graph and registered
anew, but the inferences cached for every other document - and for the
metamodel's own nodes - still held the removed instances. A removed type is
assignable to nothing, not even to the new instance of the same class, so in
the workbench a call argument typed in one file no longer matched the
parameter of the transformation it calls: the callable-transformations
sample showed "Argument of type 'Placement' is not assignable to parameter
'placement' of type 'Placement?'" and "'Service' is not assignable to
'Component'" in move-service.mt. The headless services build each file once
and never saw it.

Typir clears its cache the same way when an inference rule is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A folder of the top level is an <li> directly in the tree's <div>, outside
any list, so the browser drew a bullet (on its own line) next to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and end nodes, added from the nodes' context actions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its origin

script-execution, model-transformation-execution and the optimizer nodes defaulted to
BACKEND_API_URL=http://backend:8080 (and .env.example set the same for the first two), while every
other service gets http://backend:8080/api. The backend serves everything under /api, the JWKS
included, so with these defaults the three services could not fetch the keys and rejected every
token the backend issued (401 on every execution).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as it is listed

The tree was loaded depth-first, one listing at a time, and only shown once the whole project
had been listed. Folders are now listed breadth-first, up to 8 at a time, and every listing is
added to the tree as it arrives, so the top levels appear right away. Listings still pending for a
previous project are dropped; a folder whose listing fails stays empty without stopping the rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d every other dependency at its newest

- Language stack: langium 4.2 -> 4.4, chevrotain 12 -> 13.2, vscode-languageserver 9 -> 10.1,
  vscode-languageserver-protocol/-types 3.17 -> 3.18.4, vscode-jsonrpc 8.2.0 -> 9.0.3.
  typir-langium 0.3.3 (newest) still declares langium ~4.2.0; an override gives it 4.4.
  Protocol and types are overridden to 3.18.4, the version vscode-languageserver and
  vscode-languageclient pin, so langium's ~3.18.2 does not pull in a second copy with jsonrpc 10.
- Editor stack: @codingame/monaco-vscode-* 25 -> 37.6 (monaco-languageclient 11 requires ^37.6),
  monaco-languageclient 10.7 -> 11.0, vscode-languageclient 9 -> 10.1.
- GLSP 2.7 -> 2.8. It still pins vscode-jsonrpc 8.2.0, inversify 6 and snabbdom 3.5 and keeps its
  own jsonrpc copy; glspModule.ts converts between the two MessageConnection types where GLSP is
  handed the Langium connection (all messages on it are created from one copy).
- TypeScript 5.9 -> 6.0 (typescript-eslint supports < 6.1). Its side-effect import check needs a
  declaration for the editors' "<package>/styles" stylesheets.
- LSP 3.18 diagnostics may carry markup; reports and diagram markers take its text.
- The workbench's plugin refs are shallow: deep unwrapping the new Monaco types exceeded the
  type checker's instantiation depth, and the plugins are replaced as a whole anyway.
- Everything else to its newest version (fastify, vite, vue, lucide, reka-ui, eslint, prettier,
  @vueuse 15, plotly.js-dist 4, ...); the lockfile is regenerated, so transitive dependencies are
  current too. DOMPurify is overridden to 3.4.17 (Monaco 37.6 pins the vulnerable 3.4.15).

The 32 model-transformation call fixtures regenerate byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The backend test workflow was the last one on checkout v5; every other action in the workflows
is already on its newest major. No inputs change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… busybox 1.38

Helm provider 3 takes the kubernetes configuration and set values as attributes instead of
blocks; the two places that used blocks are adapted. The kubernetes resources were already the
_v1 ones that provider 3 keeps. The OpenTofu lock files are updated to the new provider versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry other dependency at its newest

kotlin 2.4.10 -> 2.4.21, ktor 3.5.2 -> 3.6.0, exposed 1.4.0 -> 1.6.0, postgresql 42.7.13 -> 42.7.14,
logback 1.6.3 -> 1.6.6, jgit 7.3 -> 7.8, apache-sshd 2.15 -> 2.20, bouncycastle 1.79 -> 1.86,
kotlinx-serialization 1.11 -> 1.12, auth0-jwt 4.6.0 -> 4.6.2, testcontainers 1.20.4 -> 2.0.5,
asm 9.10.1 -> 9.11.1, jacoco 0.8.15 -> 0.8.16, tinkerpop 3.8.1 -> 3.8.2. The rest was current.

- script and model-transformation pinned jacoco 0.8.14 and model-transformation-execution pinned
  tinkerpop 3.8.0 by hand; they now take the catalog versions.
- Testcontainers 2 renames its modules (testcontainers-postgresql, testcontainers-junit-jupiter)
  and deprecates the self-typed containers.PostgreSQLContainer; the tests use
  org.testcontainers.postgresql.PostgreSQLContainer, which needs no Kotlin subclass.
- Ktor 3.6 deprecates readRemaining(max) for readBuffer(max), which reads the same way: up to max
  bytes or until the channel closes.

./gradlew build: 5283 tests, all passing (Postgres tests against a real container).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation in report.json, with the hypervolume's normalisation
Copilot AI balanced review requested due to automatic review settings November 3, 2026 05:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@szschaler szschaler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this as discussed. I'm not going to run a Copilot review because that's just going to eat all my credits for November in one fell swoop...

As discussed, we need to change our way of working towards smaller, continuous progress rather than big-bang PRs like this.

@nk-coding
nk-coding merged commit e581935 into main Nov 3, 2026
19 checks passed
@nk-coding
nk-coding deleted the nk/sync-2026-11-03 branch November 3, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants