Stored formats#

Everything NeuralUI stores, where, and how its format is versioned. When a format changes, bump its version, add a migration for the older version, and note it in the changelog.

What

Where

Version

Migration

Query history

NeuralUI service: slabs/neuralui.lmdb, db history

STORE_VERSION in neuralui/store.py (stored in db meta, key version)

Store._migrate() runs on start. A store from a newer NeuralUI is refused.

Share links

the same slab, db shares, indexed by user in db usershares (version 2)

STORE_VERSION (3)

as above; version 1 → 2 builds the usershares index of existing links

Background jobs

the same slab, dbs jobs and jobdata (version 3)

STORE_VERSION

version 2 → 3 adds the (empty) dbs. A job running when the service stops is loaded as interrupted.

Admin action settings

the same slab, db meta, key actionconf

the record’s shape

Settings naming the built-in actions by position (neuralui:<n>, 0.10 and earlier) are renamed to their ids (neuralui:<id>) as they are read.

Preferences

Cortex user profile, neuralui:prefs

v in the object (PROFILE_VERSION in web/js/state.js)

migrateProfile() runs when the UI reads it. Unknown keys are kept.

Open tabs

Cortex user profile, neuralui:tabs

v, as above

as above

Saved queries

it:exec:query nodes tagged #meta.neuralui.query

:opts.neuralui.v (QUERY_FORMAT in web/js/queries.js, queryOpts() in the Storm module)

:text is the query, :language=storm, :opts the Storm options plus neuralui: {v, name, desc}, :synuser, :time. Version 1 is the first. The 0.4 format (meta:note, :type=neuralui.query, name and description as leading // lines) converts with neuralui.query.migrate --apply.

Scrape sessions

meta:note nodes, :type=neuralui.scrape, linked -(about)> to accepted nodes

the note type

:text is the scraped text. Stable.

HTTP sessions

NeuralUI service (Synapse cell sessions)

Synapse

NeuralUI adds neuralui:active (last activity, for the idle timeout).

Records#

history key: user iden (16 bytes) + time (8 bytes, big endian ms) + 4 random bytes. Value (msgpack):

{query, mode, view, count, took, error, time}

shares key: the share id (11 url safe characters). Value (msgpack):

{kind: query|node, user, username, time, view, query, mode, title}   # kind query
{kind: node, user, username, time, view, iden}                       # kind node

jobs key: the job iden (16 bytes). Value (msgpack):

{iden, user, label, query, batch, opts, status, started, finished, done, count, dropped, counts, error, resumed, saves}

status is running, done, cancelled, failed or interrupted; done is the batches finished.

jobdata key: the job iden (16 bytes) + a kind (1 byte) + a number (8 bytes, big endian). Kind i (number 0): the inbound node idens. Kind n: [[iden, form], ...], the nodes first yielded since the last save; kind m: [[kind, text], ...], its messages since then. The number is the job’s saves count at that save.

neuralui:tabs profile value:

{v, rev, writer, active, tabs: [{id, title, query, mode, kind, stormMode, limit, saved, scrape, view}]}

rev and writer detect two windows saving at once; view is the remembered table and graph state (filter, collapsed sections, sorts, scroll, selection, graph positions).

neuralui:prefs profile value: {v, theme, view, time:zone, results:cap, colwidths, hiddencols, tagcols, tagcolors, notify, ...}.

Exports#

Exports are not stored by NeuralUI; their formats belong to Synapse (.nodes: the exportStorm msgpack stream) and STIX 2.1.