The exported project: one HTML file
archec site main.arche -o project.html (in VS Code: arche-lang: Export Project
as HTML…, in the Model view's title bar and an .arche file's context menu)
writes the whole project as one HTML file. Send it, put it on an intranet, open it
from a USB stick: it needs no Arche, no server and no network. Everything it shows
is in the file.
It makes no network request. Its scripts, styles, icons, pictures (as data:
addresses), words and data are in it; it loads no font, script, stylesheet or picture
from anywhere and its code calls no server (no fetch, no XMLHttpRequest, no socket),
the simulation's frame included. Its content security policy (default-src 'none')
makes the browser refuse any request all the same. The tests check both: the file's
text, and a run in headless Chrome whose network log shows no request from the page.
What it shows#
| Page | What |
|---|---|
| Overview | The project: how many requirements (and how many pass, fail, are untested), files, named elements, diagrams, test cases; the folders of generated code. |
| Requirements | A tree, Parents › children: a requirement under each requirement it derives from or refines (or a trace derives/trace refines names), a child of several parents under each, marked also under …; or By component: under each component that satisfies it, "Not allocated" apart. The status chips and the documents in the left column filter it (what does not match stays, dimmed, when something under it does). "the whole tree, drawn" shows it as a graph. |
| A requirement | Its text, each word of it that names an element (TRACKING, CONTROLEUR) a link to its code — to the nearest when several are called so, the others after it as small 2, 3… —, and its properties, the line it is written on, the pictures it names; its Parents, Children, what it is Satisfied by and what else names it (each a link to the code); the cases it is Verified by with their last result (.arche/evidence), and ▶ to run them here. Above them, its graph: Around this requirement (the default: parents above, children below, what satisfies it on the left, the cases on the right, one hop each way) or Whole tree (a lane per level; past 40 requirements only the first level is open, ± opens a requirement's children). The colours: verified, failing, not verified, not allocated. A box opens its page or its code. |
| Model | The model's tree, as VS Code's Model view: a line opens its code, ◫ its diagram. |
| Diagrams | Every diagram archec draws (systems, components, state machines, scenarios, deployments), as SVG: drag to move, the wheel to zoom. A state machine draws, dashed, the transitions its bodies make with goto (hover one for its cause; see the spec). The menu lists the top level, as Architecture, Behaviour and Scenarios; a click on a block opens its inside (Shift+click: its code), the crumbs above lead back up, and All diagrams lists every one as a tree by component, with a filter. A scenario can be stepped through (below). |
| Code | Each file of the model, coloured; every name is a link to where it is declared, and a declaration's name lists where it is used. The left column: By file, each file and its declarations (components, their functions, ports, state machines, requirements, test plans…), or By component, each component, where it is declared and every other file that names it or its members. The file and the declaration open are shown in it. |
| Tests | By test plan: each plan and its cases, with their last recorded result, or the result of a run here; ▶ runs one, or all, in the page. By component: each case under each component it exercises, and how it got there — via REQ-…, a requirement it verifies that the component satisfies, or drives …, an element of the component its steps set or read. Cases that reach no component are listed apart. |
| Simulation | The browser simulator's player (archec sim --html), on one screen: the toolbar and the time bar on one line, the diagram taking the space, and beside it a panel of tabs — Screens, Trace, Messages (send one), Timeline (its Add a signal… picks a component first, filtered as you type, then its signals) — each scrolling on its own, a splitter between the two (under 900 px tall, the panel goes under the diagram). The run is kept when you go to another tab and come back. |
| Generated code | The folders archec generated into (found beside the model and its folder, or --generated <dir>): each file, and on each line that comes from the model, ↩ to that model line. The left column: By component, system › component › the files it mostly comes from (counted by the lines of the elements its .archec/genmap.json tags), the files of no component (the runtime, shared types) under "Shared"; or By folder. The file open is shown in it. |
| Product screens | The screens of the product's display, drawn with sample values: each with its title, the component it belongs to and the line it is written on. |
Each tree has a filter box: what matches, what it is in and what is in it stay.
A search box finds requirements, named elements, diagrams and files.
Back and Forward (the browser's, or Alt+← / Alt+→) give each page back as it was left: the scroll of the page and of the left column, a diagram's pan and zoom. A page opened anew starts at the top.
Theme and language#
The header has two pickers. Theme: Auto (the system's light or dark), Light or
Dark; the diagrams, the code, the requirement graphs and the simulation (its diagram,
trace and timeline) follow it. The product's screens keep their own look, as the
product draws them (their theme). Language: the page's words — menus, headings,
buttons, tips, empty states, the simulation's controls — in English or French, numbers
and dates as the language writes them. It opens in the model's first languages
entry when the page has it, else in the browser's language, else in English. A
language with its region (fr-FR, or fr_FR, read as fr-FR) takes the words of its
base one (French) and writes numbers and dates as that region does; an entry that is
no language tag is left out, and archec site says so. Both choices are kept in the
browser (its local storage, for files opened from disk); the page works the same where
that is not allowed. Pages opened from disk share that storage, so the language is
kept for each project (its title and model file): choosing English in one exported
project leaves another in its own language. The theme is kept for every page: it is
the viewer's taste, not the project's.
The model's own texts follow the language too: a requirement's name, text and
rationale, an element's or a case's name, a screen's title, a diagram's name in the
menu — wherever the model has a translation ("Texte" en "Text", a translations en
block). Where it has none, in a language the model is translated into, the text is
shown as written with a small mark (FR, the model's first languages entry) saying
it is not translated; a model that has no languages cannot say which language it is
written in, so the text is only underlined with dots, its tooltip saying so. Codes and
identifiers (SSS, HRS-TILE) are never marked. What the drawings themselves say
(the names in a diagram, in the simulation's blocks) and the code are as written, but
for a state diagram's legend and the — states of its title.
A language is a table of the page's words: src/sitewords.ts, keyed by the English,
and the simulation's beside it (src/websimeasy.ts EASY_WORDS). Changing the
language opens the simulation again in it (its run starts over).
On a phone, or a window narrower than 760 px, the page is one column: ☰ opens the left column over it, and following a link (or Escape) closes it.
In the simulation, a value too long for its block (a long array) is cut with "…" and shown whole under the pointer; a fraction is shown to 6 significant digits, and a value not set yet as "–".
A scenario of several sequences#
A scenario whose steps are written in several sequences has a page that draws every
one of them, in the scenario's order, as a sequence diagram (its lifelines, its alt,
opt, loop… frames), each under its title and its doc comment; and a page for each
sequence alone (seq:<scenario>.<sequence>). In the menu, the open scenario lists its
sequences under it; All diagrams puts them under their scenario. A click on a
message opens its line; on a ref box, the sequence it plays — in the same scenario
or in another (ref other.seq); Shift+click, the line of the ref. A scenario of a
single sequence is drawn on its blocks and stepped through, as below.
archec diagram main.arche --list lists the scenario, then each of its sequences, and
--all -o dir writes a file for each. The scenario's own key draws all its sequences in
SVG and with --md (each under its title); a plain Mermaid or D2 file holds one diagram,
so it is the first sequence, with a comment naming the others.
A scenario, step by step#
A scenario is drawn standing still on its system's block diagram: each message an arrow with its number, the messages listed beside it (a scenario of more than eight messages is a small frame per message). Nothing moves until you ask:
| ▶ Play | plays the messages once, one every 1.6 s, and stops on the last |
| → / ← | the next message, the one before |
| Home / End | the first message, the last |
| a message in the list, or its number on the drawing | that message |
| Space | play / pause |
The counter says where you are ("message 3 of 12"). A message lights its two blocks
— outlined in their own shape — and the link it takes; a participant nested in a block
is drawn as a small box of its own inside it. With reduce motion set, the link is
not drawn in, it is just there. archec diagram --play still writes the animated SVG
(SMIL) for a README.
The simulation runs in the page#
The file carries an archec built for the browser (dist/site-runtime.js, about
1.3 MB gzipped) and the sources the program read. ▶ checks them and runs the case
on the browser simulator, as archec test --sim web does: the same verdicts, each
expectation with its time. Nothing is fetched: Python the action language cannot
say is not run (there is no Pyodide); a case that reaches it is inconclusive.
Size#
The data is gzipped in the file and read back with the browser's
DecompressionStream (a browser from 2023 or later). archec site prints each
part's share. Leave out what is not needed: --no-generated, --no-sim (no
player, no archec in the page: about 2 MB less).