Skip to content

arigl-web + ari page: stock browser hosts that run .ari documents by URL; arigl and arigl-web packages - #887

Merged
transfix merged 13 commits into
masterfrom
claude/festive-payne-fc37ba
Oct 30, 2026
Merged

transfix merged 13 commits into
masterfrom
claude/festive-payne-fc37ba

Conversation

@transfix

@transfix transfix commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Makes arigl and ari distributable as stock hosts for other people's documents. These are items L8 and L10 for nicotina, a TX.WTF client written entirely as .ari documents (cy-pca/nicotina docs/ROADMAP.md). The owner's direction: the terminal backends are first-class, so nicotina must run in ari (FTXUI and tvision) as well as arigl and the browser.

L8: browser pages that run a document by URL

  • arigl-web. A wasm build of arigl without the examples is now arigl-web, with no documents of its own. Its page (src/arigl/web/arigl-web.{html,js,css}, shipped as index.html) runs arigl run <config flags> <src URL> <document args>. ?src= is resolved against the page, and the default is main.ari.
  • ari's terminal page. src/ari/web/ari.html, over xterm.js, does the same for ari: ari run <flags> <src URL> in the FTXUI backend. It runs ?src=, a config naming a document, or the build's default (CVC_ARI_WASM_DEFAULT_SRC). The default is main.ari in the arigl-web package and the baked tour in the gallery. ari_tvision's page runs its documents on the tvision desktop.
  • How a document loads. Before the load, the runtime fetches the document set into MEMFS. The code is cvc/ariadne/web_document.h in libcvc, shared by both runtimes:
    • first the document;
    • then every file it names by a path (import:, load:, vinay:), resolved against the URL of the file that names it;
    • then the files those name.
      Each file is written at its URL path, the runtime changes to the document's directory, and the local copy loads. Relative references resolve exactly as on disk, and the loader knows nothing about URLs. cvc:// is the embedded component library; https:// and state:// are left to the loader's handlers.
  • Unit-tested natively. The walk is cvc/ariadne/doc_fetch.h, with an injected fetcher, tested by ariadne_doc_fetch_test (9 tests). One test checks that the walk's resolution agrees with the loader's file scheme. Another loads a written set end to end.
  • Same origin only by default. The page config (ariadne.config.json, read by both pages) can allow other origins (src_origins). It can also pin the document (src_param: false), which a site serving untrusted uploads from the same origin should do.
  • Host flags come only from the config, never from the URL. The flags array is passed verbatim before the document, with {origin} replaced by the page's origin. This matches the net-policy work's general flags (--net, --net-allow ORIGIN, ...), so nicotina's config is "flags": ["--net"]. That work is not in this PR.
  • Errors. arigl-web shows an error page with everything arigl printed. ari.html prints what ari said into the terminal.
  • CSP. All the pages are CSP-clean under script-src 'self' 'wasm-unsafe-eval'; style-src 'self': nothing inline, and nothing evals (cvcGL's touch probe moves from emscripten_run_script_int to EM_JS).
    • ari.html's loader and styles are now ari-web.js and ari-web.css.
    • xterm.js and its fit and WebGL addons are served beside the page in xterm/, not from jsDelivr. The build takes them from CVC_XTERM_DIR, else cvcpkg's new xterm-js* packages in the prefix (cy-pca/cvcpkg#503), else the same npm packages downloaded once and checked by SHA-256.
    • The WebGL addon loads before the terminal opens, so xterm.js never builds its DOM renderer, which injects <style> elements.
    • build-pages.py copies a page's <page>.page-files, so the gallery's ari pages get their files.
  • Single-threaded by default, so no COOP/COEP is needed and the pages can live at /apps/<app>/ on an ordinary site. docs/CVCGL_WASM.md says what wasm-mt needs.
  • Native, both runtimes.
    • arigl run and ari run <prefix>/share/<app>/main.ari (FTXUI or --backend tvision) go through the same loader, and imports resolve against each file's directory. ctest arigl_docset / ari_docset check this from another working directory with src/cvc/tests/data/ariadne_docset.
    • What did not work before was cvc:// in a relocated install: the compiled-in datadir names the builder's prefix. cvc_uri_search_dirs now also searches share/libcvc/ariadne beside the file holding libcvc.
    • Checked on a relocated cmake --install: arigl snapshot, ari snapshot, ari run (FTXUI) and ari run --backend tvision under a pty all show the imported files and the component library. Without the components installed, the old search list fails.

L10: packages

  • cvcpkg/recipes/arigl installs bin/arigl. It builds src/arigl standalone against the installed libcvc + cvcgl SDKs, as ari's recipe does.
    • Platforms are linux and windows. macOS is left out: there is no VTK or cvcgl macOS bundle on the catalog yet.
    • It must be built against the libcvc of the same tree.
  • cvcpkg/recipes/arigl-web installs share/arigl-web/ for wasm and wasm-mt: index.html, arigl-web.js/.css, arigl.js, arigl.wasm, THIRD_PARTY_NOTICES.md, LICENSE.
    • The wasm column also ships ari.html, ari.js and ari.wasm.
    • It adds ari_tvision.* when the deps prefix has tvision's browser console: cvcpkg's tvision recipe, cvc.4, wasm column. That recipe is merged (recipe(tvision): wasm and wasm-mt, with a browser console (cvc.4) cy-pca/cvcpkg#436) but its wasm column isn't published yet. Built from it locally, the package has the tvision page and the headless test passes on it.
    • It prints every module's raw/gzip/brotli sizes on each build.
    • CVC_ARIGL_WEB_LEAN=1 builds a smaller variant.
  • Both pass cvcpkg validate. Both build and cvcpkg pack locally: arigl linux-x86_64 is 104 KB, arigl-web wasm 13.9 MB (before the ari page was added).
  • cvcpkg install-deps cvcpkg/recipes/arigl-web --platform wasm resolves.
  • Not yet wired into a publish workflow. That is a follow-up.

Sizes (the M0 measurement)

Single-threaded, emsdk 5.0.7, -O3:

Module raw gzip -9 brotli -q 11
arigl.wasm as packaged (the gallery's features) 49.0 MB 13.8 MB 9.5 MB
arigl.wasm, CVC_ARIGL_WEB_LEAN=1 (no ImageMagick/assimp/mesher/SDF/libigl) 33.7 MB 9.0 MB 6.1 MB
arigl.wasm as packaged, linked without Asyncify (cannot run; for scale) 31.8 MB 9.9 MB 7.3 MB
ari.wasm as packaged 21.7 MB 7.1 MB 5.1 MB
ari.wasm, lean 7.7 MB 2.8 MB 2.1 MB

arigl.js is 325 KB raw, 68 KB gzip and 59 KB brotli. ari.js is 109 KB, 26 KB and 23 KB.

Code by library, from a --profiling-funcs link:

  • VTK is 34% of the packaged arigl's code (14.9 of 43.3 MB). In the lean build, VTK + cvcGL are about three quarters of the module: lean ari, which is libcvc alone, is 7.7 of lean arigl's 33.7 MB.
  • Asyncify accounts for about 40% of the code.

An ImGui-only host is the lean ari with ImGui in place of FTXUI. It is estimated at about 9-10 MB raw and ~2.5 MB brotli: a quarter of the lean shell. Dropping Asyncify would cut about a third more. docs/CVCGL_WASM.md has the table and the reasoning.

Tests

  • Unit: ariadne_doc_fetch_test 9/9. ariadne_loader_test 199/199 with the cvc:// change. Local native ctest run: (ari|arigl)_(docset|url_document) and the Ariadne URI/component/modularity/doc-fetch suites, 72/72.
  • Headless browser: src/arigl/web/test/arigl_web_smoke.mjs uses Node 22's http and WebSocket and drives Chrome over the DevTools protocol, with no npm. It serves every page from an ordinary path with no COOP/COEP and under a strict CSP, and fails on any CSP violation a page reports. Eight cases:
    • arigl-web: a same-origin document set loads and runs;
    • arigl-web: the default main.ari loads;
    • arigl-web: a cross-origin src is refused;
    • arigl-web: a missing document shows the error page;
    • ari.html: the same set loads, its text checked on the terminal;
    • ari.html: the default document loads;
    • ari.html: a cross-origin src is refused, with the reason in the terminal;
    • ari_tvision.html: the same set on the tvision desktop (when the package has the page).
      All 8 pass on the packaged build, with tvision built locally from cvcpkg's recipe. On the lean build, the ari cases pass, and the arigl cases passed before I renamed the page hooks (that lean arigl was not rebuilt after).
  • New CI job arigl-web: builds both pages with the recipe's script and runs that test. It runs only when the pages, the loader, the fixture, the recipe or ci.yml change. It compiles libcvc + cvcGL for wasm, so it is long (timeout 150 min). The existing ari-wasm job also rebuilds ari for wasm with the shared loader.

Follow-ups

arigl built to wasm without the examples is now arigl-web, a host for anyone's
.ari documents. Its page (src/arigl/web/arigl-web.{html,js,css}) runs
`arigl run <config flags> <src URL>`. Before the load, arigl fetches the
document and every file it names by a path (import:, load:, vinay:, then the
files those name) into MEMFS at their URL paths, and runs the local copy, so
relative references resolve as they do on disk.

- cvc/ariadne/doc_fetch.h: URL parsing, reference resolution that agrees with
  the loader's file scheme, the same-origin rule, and the fetch walk over an
  injected fetcher. Tested by ariadne_doc_fetch_test.
- Same origin only unless the page config's src_origins allows another.
  Host flags come only from the config, never from the URL.
- A failed load shows an error page with what arigl printed. No inline code
  and no eval, so the page runs under a strict CSP; cvcGL's touch probe moves
  from emscripten_run_script_int to EM_JS.
- cvc:// also searches share/libcvc/ariadne beside the file holding libcvc, so
  a relocated install (a cvcpkg prefix) finds its own component library.
- ctest arigl_docset runs a document set from another directory;
  src/arigl/web/test/arigl_web_smoke.mjs checks the shell in headless Chrome.
…Chrome

- cvcpkg/recipes/arigl: bin/arigl, built standalone against the installed
  libcvc and cvcgl SDKs, like ari (linux, windows; macOS waits on VTK/cvcgl).
- cvcpkg/recipes/arigl-web: share/arigl-web/ (index.html, arigl-web.js/.css,
  arigl.js, arigl.wasm, notices) for wasm and wasm-mt. Its script prints the
  module's raw/gzip/brotli sizes; CVC_ARIGL_WEB_LEAN=1 drops ImageMagick,
  assimp, the mesher, SDF and libigl.
- ci.yml arigl-web: builds the shell with the recipe's script and runs the
  smoke test in headless Chrome, served from an ordinary path with no
  COOP/COEP and a strict CSP. It runs only when the shell or its loader change.
- docs/CVCGL_WASM.md: the shell, its config, wasm-mt, and the sizes: 49.0 MB
  raw / 9.5 MB brotli packaged, 33.7 / 6.1 MB lean, what VTK and Asyncify
  account for, and what an ImGui-only host would save.
…ment sets tested in both runtimes

nicotina must run in ari's terminal backends as well as arigl and the browser.

- The browser staging moves from src/arigl into libcvc
  (cvc/ariadne/web_document.h), shared by arigl and ari. The page config is now
  ariadne.config.json; the env and page hooks use the Ariadne names.
- ari.html runs a document by URL: ?src=, a config naming one, or the build's
  default (CVC_ARI_WASM_DEFAULT_SRC; main.ari in the arigl-web package, the
  baked tour in the gallery). It honours the same config and same-origin rule,
  and prints what ari said into the terminal when the load fails. ari_tvision's
  page runs its documents on the tvision desktop. ari's component library
  moves to /usr/share/libcvc/ariadne in MEMFS, out of a site's path space.
- ctest ari_docset / ari_url_document mirror arigl's. The fixture moves to
  src/cvc/tests/data/ariadne_docset.
- The arigl-web package (wasm column) ships ari.html/ari.js/ari.wasm, and
  ari_tvision's page when the deps prefix has tvision's browser console. The
  headless test checks ari's page too, reading the terminal's text.
- Sizes: ari.wasm 21.7 MB raw / 5.1 MB brotli, lean 7.7 / 2.1 MB. The
  ImGui-only host estimate is revised down to ~9-10 MB raw, ~2.5 MB brotli.
@transfix transfix changed the title arigl-web: a stock browser host that runs .ari documents by URL; arigl and arigl-web packages arigl-web + ari page: stock browser hosts that run .ari documents by URL; arigl and arigl-web packages Oct 30, 2026
…ion page in arigl-web

- ari.html has no inline code or style. Its loader and styles move to
  src/ari/web/ari-web.{js,css}, and it takes the module, label and default
  document from data- attributes. xterm.js and its fit and WebGL addons are
  served beside the page in xterm/ (with their licences) instead of jsDelivr,
  so the page runs under script-src 'self' 'wasm-unsafe-eval'; style-src
  'self'. The WebGL addon loads before the terminal opens, so xterm.js never
  builds its DOM renderer (which injects <style> elements).
- The build takes xterm.js 5.5.0, addon-fit 0.10.0 and addon-webgl 0.18.0
  from CVC_XTERM_DIR, else cvcpkg's xterm-js packages in the deps prefix
  (share/xterm.js; cy-pca/cvcpkg#503), else the same npm packages downloaded
  once and checked by SHA-256. All three match the SRI hashes the page used
  to pin.
- build-pages.py copies what a page's <page>.page-files lists along with it,
  so the gallery's ari pages get their files.
- The headless test now serves every page under the strict CSP, fails on any
  violation the page reports, and runs the document set on ari_tvision's page
  when the package has it. Built against cvcpkg's tvision wasm recipe (cvc.4),
  all 8 cases pass.
…e-fc37ba

# Conflicts:
#	.github/workflows/ci.yml
…e gallery

The three packages are on the catalog (populate run 41005173700) and match the
files the build has been downloading byte for byte. They are noarch, so they
cannot be listed in the arigl-web recipe yet: a wasm resolve is static, and
cvcpkg matches no static request to a noarch (shared) bundle. So the ci.yml
arigl-web job and the gallery deploy install them beside the deps with
--platform any. The CI job also checks that ari's page took xterm.js from the
prefix rather than the download. The recipe and docs/CVCGL_WASM.md say how.
…e-fc37ba

# Conflicts:
#	src/ari/CMakeLists.txt
#	src/cvc/CMakeLists.txt
nicotina takes its server as a document argument (--instance), and in a browser
that is the page's own origin. A shared ariadne.config.json could only name it
per instance, because {origin} was replaced in `flags` alone. Now it is replaced
in the config's `args` too. The URL's ?arg= values are still taken as given.

The document-set fixture takes --instance and shows it. The headless test
serves the same app with a config passing `--instance {origin}` and checks that
ari's terminal shows the page's origin.
transfix added a commit to cy-pca/nicotina that referenced this pull request Oct 30, 2026
transfix/libcvc#887 (0f627c9e) replaces {origin} in a page config's args as
well as its flags.
transfix added a commit to cy-pca/cypkg that referenced this pull request Oct 30, 2026
… GitHub Pages (#2)

* Browser path: ari's wasm page serves cypkg; a headless Chrome test in CI

tools/site.sh assembles /apps/cypkg/ from ari's xterm.js page
(transfix/libcvc#887) and share/cypkg/. web/ariadne.config.json pins
main.ari, turns the network on for the page's own origin and passes
--server {origin}, so cypkg browses the registry that serves it. The
fixture registry serves a site too (--site), with a strict CSP.

tests/browser.mjs drives the page in headless Chrome over DevTools with
real keys and checks the terminal's text: 7 steps, passing locally. The
first results show 3.7 s after navigation; ari.wasm is 3.1 MB gzipped.

CI gains a browser job that builds ari's single-threaded wasm page from
libcvc with #887 too and runs the test. tools/libcvc.sh does both jobs'
fetching and merging; tools/libcvc-resolve.py resolves the one known
conflict (#887 and #896 in src/ari/main.cpp) and fails on any other.

* GitHub Pages: deploy main's tested page, browsing cvcpkg.org

Until a registry serves /apps/cypkg/, CI publishes the browser build to
https://cy-pca.github.io/cypkg/. The browser job assembles it from the
page it just tested, with web/ariadne.config.pages.json
(--net-allow https://cvcpkg.org, --server https://cvcpkg.org), and a
pages job deploys it on pushes to main. tools/site.sh takes the config
as an optional third argument.

That origin needs cvcpkg.org's CORS to allow it. Served locally from a
plain static server, the page loads and runs, and its search is blocked
only by the missing Access-Control-Allow-Origin (roadmap C5).

* CI: resolve include-only libcvc conflicts; #883 now clashes with master

libcvc master (#889) added #include <cstdlib> at the top of
state_exec_builtins_test.cpp, where #883 adds #include <cmath>, so #883
stopped merging and both CI jobs failed at their checkout. A conflict
whose two sides only add #include lines now keeps both, sorted, in any
file. With it, all seven PRs merge onto master again, and tests/run.sh
passes on the ari built from them.

* tests/browser.mjs: wait for Chrome to exit before removing its profile

In CI every step passed, then rmSync failed with ENOTEMPTY on the
profile Chrome was still writing as it shut down, and the job failed.
Wait for Chrome's exit (at most 5 s), retry the removal, and never let
cleanup change the result.

* CI: llm-gate, as cy-pca's other repos have

cy-pca/llm-gate@v1 fails a pull request (and a push to main) whose
commits, title or description carry AI-assistant attribution: co-author
trailers naming an AI, "generated with" footers, AI session links, AI
bot authors. The same workflow as cy-pca/cvcpkg's, on main.
transfix added a commit to cy-pca/cypkg that referenced this pull request Oct 30, 2026
* Browser path: ari's wasm page serves cypkg; a headless Chrome test in CI

tools/site.sh assembles /apps/cypkg/ from ari's xterm.js page
(transfix/libcvc#887) and share/cypkg/. web/ariadne.config.json pins
main.ari, turns the network on for the page's own origin and passes
--server {origin}, so cypkg browses the registry that serves it. The
fixture registry serves a site too (--site), with a strict CSP.

tests/browser.mjs drives the page in headless Chrome over DevTools with
real keys and checks the terminal's text: 7 steps, passing locally. The
first results show 3.7 s after navigation; ari.wasm is 3.1 MB gzipped.

CI gains a browser job that builds ari's single-threaded wasm page from
libcvc with #887 too and runs the test. tools/libcvc.sh does both jobs'
fetching and merging; tools/libcvc-resolve.py resolves the one known
conflict (#887 and #896 in src/ari/main.cpp) and fails on any other.

* The cvcpkg recipe: documents and launchers, one noarch build

recipes/cypkg/ vendors this repo and installs bin/cypkg, bin/cypkg.cmd,
share/cypkg/*.ari and the licence; it depends on ari at run time, and
the launcher runs the ari beside it in the prefix. Built locally with
cvcpkg build cypkg --local --platform any, and the installed launcher
ran cypkg against the fixture registry. CI gains a job that builds the
package and checks its files.

Not published: no released ari has the libcvc PRs cypkg needs. The
recipe says to publish with a minimum ari version once one does.

* GitHub Pages: deploy main's tested page, browsing cvcpkg.org

Until a registry serves /apps/cypkg/, CI publishes the browser build to
https://cy-pca.github.io/cypkg/. The browser job assembles it from the
page it just tested, with web/ariadne.config.pages.json
(--net-allow https://cvcpkg.org, --server https://cvcpkg.org), and a
pages job deploys it on pushes to main. tools/site.sh takes the config
as an optional third argument.

That origin needs cvcpkg.org's CORS to allow it. Served locally from a
plain static server, the page loads and runs, and its search is blocked
only by the missing Access-Control-Allow-Origin (roadmap C5).

* CI: resolve include-only libcvc conflicts; #883 now clashes with master

libcvc master (#889) added #include <cstdlib> at the top of
state_exec_builtins_test.cpp, where #883 adds #include <cmath>, so #883
stopped merging and both CI jobs failed at their checkout. A conflict
whose two sides only add #include lines now keeps both, sorted, in any
file. With it, all seven PRs merge onto master again, and tests/run.sh
passes on the ari built from them.

* tests/browser.mjs: wait for Chrome to exit before removing its profile

In CI every step passed, then rmSync failed with ENOTEMPTY on the
profile Chrome was still writing as it shut down, and the job failed.
Wait for Chrome's exit (at most 5 s), retry the removal, and never let
cleanup change the result.

* CI: llm-gate, as cy-pca's other repos have

cy-pca/llm-gate@v1 fails a pull request (and a push to main) whose
commits, title or description carry AI-assistant attribution: co-author
trailers naming an AI, "generated with" footers, AI session links, AI
bot authors. The same workflow as cy-pca/cvcpkg's, on main.
nicotina-ci and others added 2 commits October 30, 2026 15:31
…oses Chrome cleanly

- arigl and arigl-web's upstream_version follow CMakeLists (3.7.5 since
  master's bump), which the "recipes match CMakeLists version" check
  requires.
- AriadneDocFetch.ResolutionAgreesWithTheFileScheme wrote a file named
  "q.ari?v=2", which Windows cannot hold. That case runs off Windows only
  (fetched files are written only in the browser build, to MEMFS), and
  each write is checked.
- arigl_web_smoke.mjs closes Chrome with Browser.close over its browser
  DevTools socket and waits for it to exit (SIGKILL after 10 s). A
  SIGTERM left Chrome's helpers writing the profile, so removing it
  failed with ENOTEMPTY after every case had passed. A profile that
  still cannot be removed is a warning, not a failure.
@transfix
transfix enabled auto-merge (squash) October 30, 2026 20:48
@transfix
transfix merged commit 297876c into master Oct 30, 2026
27 checks passed
@transfix
transfix deleted the claude/festive-payne-fc37ba branch October 30, 2026 21:27
transfix added a commit to cy-pca/nicotina that referenced this pull request Oct 31, 2026
…igl, launchers, tests) (#1)

* M0: sign in to a TX.WTF instance, then show the profile and SCRIP balance

share/nicotina/main.ari runs in stock ari (FTXUI or tvision) and arigl. It
signs in with POST /user/login and capture_auth, so the host keeps the token
and the document never sees it; GET /user/ and /billing/scrip/balance name the
credential with auth:. It handles the emailed second factor (/user/login/2fa),
a wrong password, force_password_change (change it in the web app first) and an
expired token (sign in again), and signs out with /user/logout and
net-auth-forget. requires: net and net.auth, so a host without --net refuses it.

The windows (ui/signin.ari, ui/home.ari) are laid out for an 80x24 terminal;
ImGui adds a Details window. The instance comes in as --instance (default
https://tx.wtf); --user fills in the form.

* Launchers: bin/nicotina (POSIX sh) and bin/nicotina.cmd

They find the prefix from their own path and run share/nicotina/main.ari in
arigl, or in ari in a terminal (--terminal, --backend ftxui|tvision, or no
display: no DISPLAY/WAYLAND_DISPLAY, or SSH without X forwarding). The host gets
--net --net-allow <the instance's origin> and a credential store in
$XDG_CONFIG_HOME/nicotina (%APPDATA% on Windows). Other options go to the host,
arguments after -- to the document; --dry-run prints the command.

web/ariadne.config.json is the arigl-web and ari pages' config for an instance
that serves the documents at /apps/nicotina/.

* Tests: a stub TX.WTF instance, snapshots and tmux runs

tests/stub_txwtf.py answers the five endpoints M0 uses with txwtf's shapes.
tests/run.sh checks the launcher's choices, ari check without --net, ari
snapshot in both backends (sign-in form, resumed session, expired session, an
instance that doesn't answer), arigl snapshot, and bin/nicotina in a tmux pane
in both backends typed at like a person: sign in, restart signed in, sign out,
a wrong password, the emailed code, a forced password change. No output may
contain a session token.

* README and roadmap: running M0 from a local libcvc build

How to build ari and arigl from the four open libcvc pull requests, run the
client and its tests, and serve it in the browser; the cvcpkg way once the
packages publish. The roadmap gains L11, a masked text input, which M0 needs.

* tests: remove the tmux socket a killed server leaves

* tests: no bytecode in the tree; the stub follows tx.wtf's live schema

Remove the committed tests/__pycache__, ignore __pycache__/ and *.pyc, and run
Python with -B in tests/run.sh.

The stub's replies now follow https://tx.wtf/openapi.json (txwtf 0.4.0):
ResponseSchema for /user/logout, a validation error's loc/msg/type, the User
fields a login reply requires. Its errors are the ones tx.wtf answers: 401 Not
authenticated without a token (not 403), 401 Invalid token for one it doesn't
know.

* web: --instance {origin}, so one page config serves every instance

transfix/libcvc#887 (0f627c9e) replaces {origin} in a page config's args as
well as its flags.

* tests/live.sh: the client against a live instance, as a test account

tests/live.sh signs in to a live TX.WTF instance (dev.tx.wtf) with a test
account from an owner-only env file outside the repository, in both terminal
backends: a wrong password, the profile and balance, resuming the stored
session in ari and arigl snapshots and on restart, and sign-out. The password
is typed through a tmux buffer, and no output may hold it or the session token.

The helpers both scripts use move to tests/lib.sh.

* tests/local.sh: the client against a real txwtf instance from cvcpkg

tests/local.sh starts txwtf's own server (txwtf-cp312 from a cvcpkg prefix) on a
fresh SQLite database and drives the client against it in both terminal
backends. tests/txwtf_local.py makes the accounts with txwtf's core functions:
SCRIP minted, the emailed second factor on, a forced password change.
tests/smtp_sink.py takes the instance's mail, so grace signs in with the code
from the real email. It also checks that the server refuses a token after
sign-out, the client's answer to txwtf's 429 once its login rate limit is used
up, and a server that has gone away.

The README lists the three suites: the stub (CI), a local txwtf, and a live
test instance.

* tests: run the local txwtf from the work directory, which keeps uploads/ out of the tree

txwtf makes an uploads/ directory wherever it runs, init-db included.
tests/lib.sh makes $out, $ARI and $ARIGL absolute so a script may change
directory.

* README: the browser builds on cyberpcangel.com

In the browser: the pages are public at cyberpcangel.com/nicotina and /nicotina-term, published by the deploy-cyberpcangel workflow (#2). Why that origin needs its own page config and tx.wtf's CORS (atx-crypto-club/txwtf#312), and what the pages do until then. The same-origin /apps/ setup still waits on txwtf T2.

* Home: the full handle, @user@instance, before the display name

The header shows the handle with the instance's host (no scheme, path or
default port), e.g. @[email protected]. A brokered account keeps the
home instance its txwtf username already carries (<user>@<home domain>); GET
/user/ has no other field for it. The display name is cut to fit the
window's 60 columns. ImGui's Details window lists the handle too.

The stub gains a long display name and a brokered account, and tolerates an
instance below a path; tests/run.sh checks the cut, the brokered handle, a
path and a default port, and every suite expects the full handle.

* Home: no placeholder email for a brokered account; a long email cut to fit

txwtf gives a brokered account a local email in .invalid (its real address
belongs to its home instance), so the row shows '-' for one. Others are cut to
the value column's 51 characters.

* A Refreshing... status, and a TODO for the spinner

Refresh now says so while its requests are out, as sign-in and the code check
do, so each request has a status line a spinner can sit beside. The spinner
itself waits on libcvc's widget, which animates from the host's frame clock:
the controller is parked during a request, so no state it writes could drive
one. tests/run.sh presses Refresh in both terminal backends.

* A spinner beside the status line while a request is out

While ui.busy is set, libcvc's spinner widget (transfix/libcvc#915) turns
beside the status line (Signing in..., Checking the code..., Refreshing...)
and beside Connecting to ... at start-up. It turns by the host's frame clock,
so it keeps moving while the controller is parked on the request. A host
without the widget keeps the text alone: each spinner is gated on
(has? "spinner"), and main.ari lists it as an optional requirement.

The stub's mary takes 3 s to load and slowpoke 12 s. tests/run.sh checks the
spinner in a snapshot, and in tmux under FTXUI and tvision that its glyph
changes while mary signs in; it skips those checks on an ari without the
widget.

* README: the tests run in CI; point to ci/README.md
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.

1 participant