feat(fls): export the editor model's topology to Java's view

exportProject.ts is the counterpart of importProject.ts: from the editor
model to the Java view topologyWriter.ts writes. Step X1, the topology:
each node becomes the Java device of its kind with name, position and label
flags; its ports become interfaces or ports; each link a cable drawn
between its nodes; each documentation item a GUIDocuItem. A port's MAC is
the one the simulation uses (the file's, or one derived from the port id);
a router's gateway and DNS server go to every interface, as Java's own
setters do (Java reads the first interface's only). A host with a wireless
card joins a switch by a wireless cable, the only wireless connection Java
makes. The import now enables a host's wireless by Java's card flag, also
without an SSID, where Swift enables it for every SSID.

Checked by Java: every corpus file, imported, exported and written, loads
in Java FILIUS to the topology of the original up to named departures of
the model (a derived MAC where Java rolls one at each load; documentation in
render order, with the model's empty text, Dialog 12 and minimum size where
Java has none or less). A synthetic model adds a label with IP and MAC,
positions between pixels, a five-port switch, a wireless notebook, a
three-interface router and a half-transparent bold text. 17 mutation
probes, each loaded by Java, were all caught.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 08:58:29 +00:00
co-authored by Claude Opus 5.5
parent 968dbbc34a
commit 6dc1286866
10 changed files with 15728 additions and 18 deletions
+5 -3
View File
@@ -88,9 +88,11 @@ ist, wird still 3600.
## Was Java aus unseren Dateien lädt
`run.sh` lädt auch die Dateien unter `packages/fls/test/written/`, die
`topologyWriter.test.ts` mit `UPDATE_WRITTEN=1` schreibt (nicht
eingecheckt), mit derselben Lademethode wie den Korpus, und schreibt
`packages/fls/test/written.java.json` samt SHA-256 jeder Datei
`topologyWriter.test.ts` mit `UPDATE_WRITTEN=1` schreibt, und unter
`packages/fls/test/exported/`, die `exportProject.test.ts` mit
`UPDATE_EXPORTED=1` schreibt (beide nicht eingecheckt), mit derselben
Lademethode wie den Korpus, und schreibt `written.java.json` bzw.
`exported.java.json` daneben, samt SHA-256 jeder Datei
(`--sha256`), damit der Test merkt, wenn der Befund nicht mehr zur Ausgabe
passt. Je Kabel steht auch `panel`: die Geräte, zwischen denen die
Oberfläche es zeichnet (`JCablePanel.ziel1/ziel2`) — im Korpus bei allen 183
+11 -9
View File
@@ -89,12 +89,14 @@ rm -f "$beans/beans.java.json"
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" BeansDump "$beans" "$beans/beans.java.json" 2>&1 | grep -v 'logback\|^$' || true
test -s "$beans/beans.java.json"
# What Java loads from the files packages/fls writes (topologyWriter.test.ts
# writes them with UPDATE_WRITTEN=1; the files are not checked in, their
# SHA-256 is).
written="$root/packages/fls/test/written"
if [ -d "$written" ]; then
rm -f "$written.java.json"
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" FlsOracle "$written" "$written.java.json" --sha256 2>&1 | grep -v 'logback\|^$' || true
test -s "$written.java.json"
fi
# What Java loads from the files packages/fls writes: Java's view written
# again (topologyWriter.test.ts, UPDATE_WRITTEN=1) and the editor model
# exported (exportProject.test.ts, UPDATE_EXPORTED=1). The files are not
# checked in, their SHA-256 is.
for written in "$root/packages/fls/test/written" "$root/packages/fls/test/exported"; do
if [ -d "$written" ]; then
rm -f "$written.java.json"
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" FlsOracle "$written" "$written.java.json" --sha256 2>&1 | grep -v 'logback\|^$' || true
test -s "$written.java.json"
fi
done